Formsand queries

R

RoBo

Through a query that uses grouping, I am gathering info from a City table.
The table has two fields, the key field and the field City name. Sometimes,
the query outputs two or more records.
I would like to show the output of the query in a form, not as three
separate fields, but as one field, separated with commas.

Sample of query output:
534107106 Amsterdam
534107106 Muiden
534107106 Abcoude

Sample of output in form:
Amsterdam, Muiden, Abcoude

What VBA code do I need to do in the form (and which event) to reach this
result?

Ron
 
M

Marshall Barton

RoBo said:
Through a query that uses grouping, I am gathering info from a City table.
The table has two fields, the key field and the field City name. Sometimes,
the query outputs two or more records.
I would like to show the output of the query in a form, not as three
separate fields, but as one field, separated with commas.

Sample of query output:
534107106 Amsterdam
534107106 Muiden
534107106 Abcoude

Sample of output in form:
Amsterdam, Muiden, Abcoude

What VBA code do I need to do in the form (and which event) to reach this
result?


You need to create a function to do that. Here's a popular
one:
http://www.rogersaccesslibrary.com/...Generic Function To Concatenate Child Records'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top