songofsolon
Registered User.
- Local time
- Yesterday, 23:58
- Joined
- Jul 25, 2003
- Messages
- 11
Greetings,
I have lifted VBA code from the following Knowledge Base Article:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;322813
to combine child records in a query. For my application, the SQL then looks like this:
SELECT [EVL].[ProsID], CombineChildRecords("ProsSched","ClassID","ProsID",[ProsID],",") AS CombList FROM EVL
Where:
"EVL" is the parent query
"ProsSched" is the child table
"ClassID" is the data field to be combined
"ProsID" is the link field
with comma as delimeter
And it would work perfectly, if it didn't omit exactly one ClassID from each set. For example, where table ProsSched looks like this:
ProsID ClassID
40      1
40      2
40      3
41      2
41      5
The query will return this:
40      2,3,
41      5,
including that trailing comma. If I were to add record "41,1" to ProsSched, the query would then return "2,5," for ProsID 41.
Obviously this is a cut-and-paste job, and I am just beginning to learn the very basics of VBA, so I would really appreciate any advice you could give. Thank you!
I have lifted VBA code from the following Knowledge Base Article:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;322813
to combine child records in a query. For my application, the SQL then looks like this:
SELECT [EVL].[ProsID], CombineChildRecords("ProsSched","ClassID","ProsID",[ProsID],",") AS CombList FROM EVL
Where:
"EVL" is the parent query
"ProsSched" is the child table
"ClassID" is the data field to be combined
"ProsID" is the link field
with comma as delimeter
And it would work perfectly, if it didn't omit exactly one ClassID from each set. For example, where table ProsSched looks like this:
ProsID ClassID
40      1
40      2
40      3
41      2
41      5
The query will return this:
40      2,3,
41      5,
including that trailing comma. If I were to add record "41,1" to ProsSched, the query would then return "2,5," for ProsID 41.
Obviously this is a cut-and-paste job, and I am just beginning to learn the very basics of VBA, so I would really appreciate any advice you could give. Thank you!