ConcatRelated in a query. (1 Viewer)

tucker61

Registered User.
Local time
Yesterday, 23:02
Joined
Jan 13, 2008
Messages
324
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");
 

cheekybuddha

AWF VIP
Local time
Today, 07:02
Joined
Jul 21, 2014
Messages
2,280
Assuming the query works otherwise, change this part of your statement:
Code:
"Job_ID = " & "Job_ID" & "

to

"Job_ID = " & Job_ID"
 

CJ_London

Super Moderator
Staff member
Local time
Today, 07:02
Joined
Feb 19, 2013
Messages
16,616
Think that should be

"Job_ID = " & Job_ID & "
 

tucker61

Registered User.
Local time
Yesterday, 23:02
Joined
Jan 13, 2008
Messages
324
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
 

CJ_London

Super Moderator
Staff member
Local time
Today, 07:02
Joined
Feb 19, 2013
Messages
16,616
better show the field list for your Temp_aged_claims query
 

cheekybuddha

AWF VIP
Local time
Today, 07:02
Joined
Jul 21, 2014
Messages
2,280
@tucker61 - are you sure you really need to store this calculated value?

You can just calculate it on the fly when needed.
 

Minty

AWF VIP
Local time
Today, 07:02
Joined
Jul 26, 2013
Messages
10,371
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

Top Bottom