Concatenation Of Query Text
Sep 10, 2006Can anyone please give me an Access 2000 VB module that will concatenate [Portia - 1 query.text1] with [Portia - 1 query.text2] and type the result in textbox [Alltext]? Thanks.
View RepliesCan anyone please give me an Access 2000 VB module that will concatenate [Portia - 1 query.text1] with [Portia - 1 query.text2] and type the result in textbox [Alltext]? Thanks.
View RepliesI have a table that I need to query that looks something like this:
ID Type Product ID
123 Health 323
123 Health 424
123 Dental 424
124 Health 323
125 Dental 323
What I need to see is something like this:
ID Type Product ID
123 Health 323 + 424
123 Dental 424
124 Health 323
125 Dental 323
In other words, I need to have the Product ID field concatenate for like ID and Type. I know it would likely involve writing some code but I am a total beginner in that respect and I don't know where to even begin. I could really use some help. Of course I need this as soon as possible! :(
To make matters worse (well, maybe it does), I am using Access 97.
Thanks so much!!!
Hi,
Just wondered if someone could help me with this prob?
The following text appears in a text box on a report
=[HirerCurrHouseNo] & " " & [HirerCurrAddress1] & Chr(13) & Chr(10) & [HirerCurrAddress2] & Chr(13) & Chr(10) & [HirerCurrTown] & Chr(13) & Chr(10) & [HirerCurrPostcode]
My prob is that if say "Address line2" is blank, I get horrible blank line in address (which looks rubbish when pirnting a letter!). What I would really like to do is move the lines up so they show as a proper address..
eg
Mr Joe Bloggs
29 The Street
Anytown
HD11AG
Not
Mr Joe Bloggs
29 The Street
Anytown
HD11AG
Thanks - And Merry Xmas!
Hello,
I have a query ... i hope that you can help me solve it!
I am creating a database where i was the ID to be concatenated from 3 fields. I did that well i think i did but when i save the concatenation of the ID is not saved in the table .. :confused:
In the ID field in the form i added this in its control source [ =[Field1] & "" & [Field2] & "" & [Field3] ]
.. In the form it concatenated fine but in the table all the fields are saved except for the ID ... :rolleyes:
Help please!
H ow to concatenate the records of a single field with iteself
forexample
invoice no:
1
2
3
4
5
...
i want it to be written as
1,2,3,4,5,6
can it be done
can i concatenate records with each other of the same field.
In the table, i already had a few columns:
string1 string2 string3
001 1 1.5
001 2 6.4
I'd like to add a new column and concatenate the strings in previous columns with additional characters:
string1 string2 string3 string4
001 1 1.5 c-001-b01_1_5x
001 2 6.4 c-001-b02_6_4x
002 3 7 c-002-b03_7x
Is there a good way to do this? Thanks in advance.
Hi all
Is it possible to use a variable to finish the name of a control?
e.g.
Cell = me.A1 (where A1 is a lablel with the name a1)
forms![Myform]! "Cell".forecolor = 65280
What I am basically trying to do is to have a variating control name that i can change the color of.....too long to explain why really.
Can anyone help me please....is this possible?
Thanks
Hey everyone,
Well i've searched, and have been trying to use 'fConcatenateFldGroupBy' in a query in order to perform the following combining of data with a criteria requirement...
All data is in one table: (frequently re-imported, so no relationships)
Obviously data needs to be stored more efficiently, but I have no control over the imported data structure. Here is what I'm after:
Table structure:
ID - Name - Status - Comments
1120 - One - Pass - uniquecomment1
1120 - One - Fail - uniquecomment2
1120 - One - WIP - uniquecomment3
345 - Two - Pass - uniquecomment5
345 - Two - WIP - uniquecomment6
Need a query to format data as:
ID - Name - Status - Comments
1120 - One - Fail - uniquecomment1, 2, 3...
345 - Two - WIP - uniquecomment5, 6..
As you can see comments need to be concatenated with commas seperating them.
As for the Status determination, it needs to be determined for the ID based on certain conditions. If at least 1 is fail, all fail. Iff all pass, all pass. If no fails and 1 wip, WIP, etc.
I have wasted too many hours trying to figure this out on my own, so I'm seeking your help! Any input would be appreciated. Thank you.
Please can anyone give me a piece of code to combine the text from memo fields in 25 different queries and put it in one text box for printing?
Thanks.
I have some data and I want produce a summary report. The trouble is that I need to combine F2 in to one value. AggOfF2 is produced by taking the distinct values for F2 in the group, and concatenating them together with a "/" seperating each element. I don't believe there is a built in function to do what I want, but can I create a function in VB? If so, how?
SOURCE
F1 F2 AMT
1 A 1
1 A 1
1 B 1
2 C 1
3 D 1
SELECT F1, AggFunc(F2) AS AggOfF2, SUM(AMT) as SumOfAmt
FROM SOURCE GROUP BY F1;
SUMMARY
F1 AggOfF2 SumOfAMT
1 A/B 3
2 C 1
3 D 1
Thanks,
David
This really is more of a VB than an Access question, but I need it answered, and I don't know a good VB forum so....
I have a text box that I'm trying to add text to, I have a loop, and every time through the loop it's supposed to concatenate new text into the text box by appending it to the end. I can't seem to be able to find a way to do this. I can't use the <&> operator, and VB doesn't have a <+=> operator (I wish I could do this in C/C++, but oh well). Any ideas? Or do I have to set the existing text to a string, concatenate the new text onto that, and then set it to the textbox?
know if there is a way to use a string concatenation to refer to a control name. eg. Referring to Control1, Control2, Control3, Control4, etc using something like Me.["Control" & "1"], Me.["Control" & "2"], etc
View 6 Replies View RelatedI have a column which contains "text digit text" as "AAA 222 BBB". The numbers of letters or digits can vary.
I need to SELECT the column which contains digits in a specific interval. For Example I have
"DFS 673 JKK"
"A 3454 LJLJ"
"SD 854 JKLJD"
I need to SELECT the column which contains 600 < Digit < 700 the result of the query in this case would be "DFS 673 JKK" because 673 is between 600 and 700.
Thanx for any clue or suggestion...
So i have made a query which filters the text you type in your text box on a form. This is working great, but then this morning I had some records that contain some blank fields. My query does not show those records even if they contain the same text that I would type in my search form.This is my expression in my query of one column:
Like [Forms]![searchform]![Qprojectomschrijving] & "*"
Hi, How can I make the data in a textbox on my form automatically entered as the search criteria in a query. So say the box says Mike Johnson, can I make a command button (That I can eventually subsititute as the actual box) that puts the Nma emIk Johnson into a search query and brings up all the information on him from the database?
View 4 Replies View RelatedI have a table with a rather unfriendly field. This is legacy data so it is not possible to alter the way data was input.
The file contains text in the following way.
Word1 Word2 Word3 Word4 etc...
The number of words is not constant throughout the column.
What I would like to do is split this field, so that i get each Word in a new column, ie if there are 4 words in the field, i could run a make table to give me a new table with 4 new columns, each containing one word.
I am thinking about splitting the text at the spaces. that would work very well for me.
i have a form.
i made a query , and i can see the query (there are 2 fields , and i want to see one of them) only in a subform , but i want to see the query in a simple textbox.
how can i do this thing ?
Hi Guys,
I'm new here, so hello all!! :D
I have a problem with a text box. If I show you how the output looks, you'll hopefully be able to help me sort it out.
Output looks like this:
'To facilitate the full and final payment of £0.00 ;on behalf of Royal Mail Group into
A SMITH'sbank account'
As you can see there's way too much space between each text box so is there a way that Access can shrink the box so that the big space doesn't appear? I would've done it all in one text box but some of the text needs to be bold so had to go in a different text box (or does it??!!).
Thanks for your help guys.
Richard.
Hi
I have a query with 2 fields, when it is run it returns a result based upon the result of the set criteria.
Can you get this value to be displayed in a text box after a button is pressed.
dave
Hi, newbie needs help!
I am trying to make a courses registration database. I have 3 tables; tblContacts [ContactID], [FitstName], [LastName] [Etc..] [Etc..]
tblCourseRegistration [RegID], [ContactID] [CourseID] and tblCourses [CourseID], [RegID], [CourseName], [StartDate], [AvailablePlaces]
I have created a form called Test1 that displays The CourseID, CourseName, StartDate EndDate and an unbound textbox called PlacesLeft. I would like to display in this text box the number of places that are still available on a particular course. I've written a querie that counts the CourseID's in the course registration table this works ok but I want it to place the value in the PlacesLeft text box. Then I can do a simple calculation based on the PlacesAvailable textbox. Anyone any idea how to do this My querie reads
SELECT Count([CourseID])
FROM tblCourseRegistration
WHERE (((tblCourseRegistration.CourseID)=(Forms.Test1.Co urseID)));
I tried another method which includes a command button that when clicked tries to run the following
Dim MyRS As ADODB.Recordset, strSQL As String
Set MyRS = New ADODB.Recordset
strSQL = "SELECT Count([CourseID])FROM tblCourseRegistration WHERE (((tblCourseRegistration.CourseID) = (Forms.Test1.IDNo)))"
MyRS.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
If MyRS.NoMatch Then
Me.PlacesLeft = ""
Else
Me.PlacesLeft = MyRS.Fields(0)
but Access (Ver 2000) does not like the noMatch and shows it as an error.
I would be very grateful if someone could show me how to sort this out!
Many thanks in advance
I have a query that returns the latest order date of a customer (on a sub form). I want to get the value from this query into the main form.
The idea being that everytime the customer adds a new order this value would be updated.
How do i do this?
I have a report based on a query
and it hase a [Product] and a [Quantity] field
Quantity Product
80 F2 1.25" Fiberglass Sucker Rod
60 F2 1" Fiberglass Sucker Rod
80 1" coupling
60 7/8" coupling
what i am trying to do is multiply the quantity by 37.5 if [Product] equals one of the items that are sold by the foot and leave the other items the same
this is the way it needs to display on the report
Quantity Product_Name
80 (3000') F2 1.25 Fiberglass Sucker Rod
60 (2250') F2 1 Fiberglass Sucker Rod
80 1" coupling
60 7/8" coupling
thanks for any help
Hi,
I have had a look at quite a few threads, but cannot find what i need. I am looking to show a command button if the value typed into the text box equals one of the values in the query. I understand how to show/hide a command button due to another post, but it is getting this to happen IF the text box matches one or more of the values in the query.
I have txtCustNo as the text box to type a number into
I have qryCustNo as the query name
i have cmdFindCust as command button
Should i have the code under the "after update" part of the text box also?
Thanks for your time,
Emily
I am having problems with query results appearing in a text box. The query is filtered by two combo boxes on my form. The query works fine and gives me the correct results when I run it by itself and enter the required info.
These are the two control sources I have used for the text box (without the quotes, of course):
"=qtotRecords!CountOfLast_Name" and "[qtotRecords]![CountOfLast_Name]"
Maybe including my query will help. The two control boxes on my form are cboSchool_Name and cboSeminar. This is my query:
SELECT Count(tblMain.Last_Name) AS CountOfLast_Name
FROM tblMain
WHERE (((tblMain.School_Name)=[Forms]![frmAdd]![cboSchool_Name]) AND ((tblMain.Seminar)=[Forms]![frmAdd]![cboSeminar]));
All I get in the text box is #Name?
Thank you in advance for any assistance.
Best regards,
MrAviator
Could someone tell me how to put the out put of a query into a textbox in a form.
I have asked this question on a couple of other sites but I still cant figuer this out.
I am a beginner so please make and easy explanation.
thanx
Hi,
I have a form which allows me to search between two dates by using two text boxes. The code for the query behind the text boxes is:
Between [Forms]![name of my form]![name of text box1] And [Forms]![name of my form]![name of text box2] and it works great. However, I was wondering if it was possible to use the same two text boxes on another form running from the same query, or would I have to make another query for the other form? I have tried to use "or" in my statement, eg.
Between [Forms]![name of my form]![name of text box1] And [Forms]![name of my form]![name of text box2] Or Between [Forms]![name of my 2nd form]![name of text box1] And [Forms]![name of my 2nd form]![name of text box2] but when I try the text boxes it says "Enter Parameter Value".
Thank you for all your help.