Passing variables from one query to another

G

Guest

Hello,

I am trying to create a procdure to run a query containing 2 fields.

Open another query pass one of the fields from query one to the second
query, then run a report based on the second query output the report in .pdf
format and then e-mail the report using the second field from query 1.

This procedure will loop until eof query 1.

If someone can point me in the right direction I would appreciate it.

Thank you.
 
H

heifler via AccessMonster.com

Hi Bob,
You need to learn how to open a recordset for the query that contains the
field you want to pass to the second query. You then need to save the
field's value to a public variable and write a function to retreive it. You
place that function in the second queries criteria and run the report based
on the second query.

Then you need to repeat in a loop for each record in the recordset. Search
key word, open recordset and loop in VBA.

This is fairly simple for someone who has written recordset code, however you
could learn by getting someone to write the code and explain it to you.
See my "Signature"

Bob said:
Hello,

I am trying to create a procdure to run a query containing 2 fields.

Open another query pass one of the fields from query one to the second
query, then run a report based on the second query output the report in .pdf
format and then e-mail the report using the second field from query 1.

This procedure will loop until eof query 1.

If someone can point me in the right direction I would appreciate it.

Thank you.

--
Bob Heifler
My Access Program, Owner
www.myaccessprogram.com
info (At) MyAccessProgram (Dot) com

Message posted via AccessMonster.com
 

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