Active Form Report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have about 15 forms and one unique raport. All forms have same ID and i
want to report print data from opened form (only one is open, active).
I try with Or function in raport and this work but query ask for other
closed forms.

Example (like my report query):
=[Forms]![Form1]![ID] Or [Forms]![Form2]![ID] Or [Forms]![Form3]![ID]...

How to query recognize active form from many and print ID data and ignore
other?
Thanks.
 
I would not place a criteria for this in the query. Add code to your
OpenReport like:
Dim strWhere as String
strWhere = "[ID]=" & Me.ID
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere

Your report/query is no longe "tied" to any particular form.
 
Works fine,
Thanks!

„Duane Hookom“ said:
I would not place a criteria for this in the query. Add code to your
OpenReport like:
Dim strWhere as String
strWhere = "[ID]=" & Me.ID
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere

Your report/query is no longe "tied" to any particular form.

--
Duane Hookom
MS Access MVP

Igor G. said:
I have about 15 forms and one unique raport. All forms have same ID and i
want to report print data from opened form (only one is open, active).
I try with Or function in raport and this work but query ask for other
closed forms.

Example (like my report query):
=[Forms]![Form1]![ID] Or [Forms]![Form2]![ID] Or [Forms]![Form3]![ID]...

How to query recognize active form from many and print ID data and ignore
other?
Thanks.
 

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

Back
Top