Form Query

G

Guest

I have a form (form 1) with an option group in the form footer that contains
various buttons. These buttons send different query parameters via macros and
limit the data-set in the form detail section. Each record in the form detail
section has an individual link that opens another form (form 2) to the
cooresponding record. All is well here.

Is there any way to define a single button on form 1 that opens form 2 with
ALL the records found in the form 1 query? In short, lets say that I run a
query on form 1 and find 10 records. Can I somehow automate a process where
I pass all 10 records to form 2? Thanks,
 
G

Guest

Hi, David.

All you need to do is to set the RecordSource property of Form2 after
opening it to the same query by which you're filtering the first:

Dim stDocName As String
stDocName = "YourSecondForm"
DoCmd.OpenForm stDocName
Forms!YourSecondForm.RecordSource = "YourQuery"

Sprinks
 

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