use values in table to table for query

G

Guest

TIA:

Maybe asking too much...

I have Table1 with a Field "CN" containing values. I would like to use each
value of CN in Table1 as criteria for an existing qry Query1, then save the
results as an excel file. I have the output cmd figured out and will use the
CN value as the file name but can't figure out how to go to first record of
Table 1, set a variable to the value of the field CN, use it in a query and
cycle through all CN's in Table1.

I have a command button on a form to trigger the code.

Help is much appreciated,

Joel
 
B

Bob Hairgrove

TIA:

Maybe asking too much...

I have Table1 with a Field "CN" containing values. I would like to use each
value of CN in Table1 as criteria for an existing qry Query1, then save the
results as an excel file. I have the output cmd figured out and will usethe
CN value as the file name but can't figure out how to go to first recordof
Table 1, set a variable to the value of the field CN, use it in a query and
cycle through all CN's in Table1.

Usually the OpenRecordset method will do it for you.
 
B

Bob Hairgrove

Usually the OpenRecordset method will do it for you.

.... of course, you'll need to use the MoveFirst and MoveNext methods
of the Recordset object, too.
 

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