criteria for report

T

Tony

I am working in Access XP bit database is in version 2000.

I want to create report based on query with two criterias.
I want to collect values from two separate forms. How I
can do it ?

Searching for solution I have found the code which is not
working properly. The code I am trying to use is as
follows:

In the selection forms:

----------------------------
Private Sub Continue_Click()

Me.Visible = False

End Sub
----------------------------

In the form itself:

----------------------------
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There is no data for this report. Cancelling
report ..."
Cancel = -1
End Sub

Private Sub Report_Close()
DoCmd.Close acForm, "Report Selection"
End Sub

Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "Report Selection",,,,,acDialog, "My
Report"
If Not IsLoaded("Report Selection") Then
Cancel = True
End If
End Sub

----------------------------

It is stopping in the line:

If Not IsLoaded("Report Selection") Then

What is the correct syntax. How it will look like for two
selection forms to be displayed for selection one after
another ?

Thanks for help.

Tony
 
J

Jim/Chris

In the criteria section of the query put

[Forms]![NameOfForm]![NameOfTextbox]

Jim
 
T

Tony

I would like to add two more questions to my original post.

1. What is the purpose of the argument on the end of the
line DoCmd.OpenForm.... ("My Report" in the sample".
2. On one of the form I want to ask for selection of the
time frame - from to. It is passing two arguments to the
query. How this will change the code ?

Regards,

Tony
 
Top