Concatenating Same field

  • Thread starter Thread starter dp
  • Start date Start date
D

dp

I have a query that returns all project numbers for a user id as separate
rows for display on reports and forms. It works well, but for space
purposes, I need to concatenate all of the project numbers for a user into
one field.

- e.g. [PROJ_NUM] & ", " & [PROJ_NUM] & ", " & [PROJ_NUM] & ", " & ...

I've seen many examples for concatenating different fields returned by a
query, but am stumped on how to concatenate the same field returned multiple
times.
dp
 
Create a function that builds a string by adding the project number to the
end of the string for each additional record, then returns the complete
string after the last record is read. There is a limit to the number of
characters in a single string, so if it's possible to exceed it you'll also
need to count characters to be sure you don't generate an error. Dimension
MyString then in the loop read each project number as String. MyString =
MyString + String. Append ", " between project numbers for punctuation.
 
dp said:
I have a query that returns all project numbers for a user id as separate
rows for display on reports and forms. It works well, but for space
purposes, I need to concatenate all of the project numbers for a user into
one field.

- e.g. [PROJ_NUM] & ", " & [PROJ_NUM] & ", " & [PROJ_NUM] & ", " & ...

I've seen many examples for concatenating different fields returned by a
query, but am stumped on how to concatenate the same field returned multiple
times.
dp
Many thanks for the rapid responses.
dp
 
Back
Top