ConcatRelated in a query.

tucker61

Registered User.
Local time
Yesterday, 22:36
Joined
Jan 13, 2008
Messages
341
I am using The Allen Browne ConCatRelated VBA code and this has worked well for me for a number of years.

I now want to take the Concat Field and store this data in a new field. - And i am struggling to do so.

Current Code -
Code:
tbInvoice = Nz(ConcatRelated("Invoice_Number", "TblQCPreRetailDetail", "Job_ID = " & Nz(Currentjob, 0)))

I managed to get a version working but it is not combining the records.

What do i need to change to make this work in a Query ?

Code:
UPDATE tblQCPlannedRTMCharges INNER JOIN Temp_Aged_Claims ON tblQCPlannedRTMCharges.Job_ID = Temp_Aged_Claims.Job_ID SET tblQCPlannedRTMCharges.Invoice_Number = ConcatRelated("Invoice_Number","Temp_Aged_claims","Job_ID = " & "Job_ID" & ", 0");
 
Assuming the query works otherwise, change this part of your statement:
Code:
"Job_ID = " & "Job_ID" & "

to

"Job_ID = " & Job_ID"
 
Think that should be

"Job_ID = " & Job_ID & "
 
Think that should be

"Job_ID = " & Job_ID & "
Sorry did not work.

Also Tried
Code:
ConcatRelated("Invoice_Number","Temp_Aged_claims","[Temp_Aged_Claims].[Job_ID] = " & [tblQCPlannedRTMCharges].[Job_ID] & "")

And i get all the invoices combined for all jobs.

1694112398586.png
 
better show the field list for your Temp_aged_claims query
 
@tucker61 - are you sure you really need to store this calculated value?

You can just calculate it on the fly when needed.
 
I have stored this type of thing in an Access DB for alternative part number listings, where they need processing quickly and wouldn't change very often.
On a large table the concatrelated, or equivalent function, gets very slow.
 

Users who are viewing this thread

Back
Top Bottom