Report Criteria

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

Guest

I have the following line of code for a criteria statement when opening a form

currentAppt = ("AppointmentID= " & Me.AppointmentID) & Me.LSNeeded >

The report opens without regard to the above criteria statement. How can I open the report only when there is a match
on AppointmentID and ME.LsNeeded>0
Thanks so much for your help
SM
 
I have the following line of code for a criteria statement when opening a form:

currentAppt = ("AppointmentID= " & Me.AppointmentID) & Me.LSNeeded > 0

The report opens without regard to the above criteria statement. How can I open the report only when there is a match
on AppointmentID and ME.LsNeeded>0 ?
Thanks so much for your help.
SMK

I suspect your Me.LSNeeded should actually be referring to a Field in
the Table, not to a control on your current form.
I think what you are looking for is something like this:

currentAppt = "AppointmentID= " & Me.AppointmentID & " and
[LSNeeded] > 0 "

Then your docmd should look like this:
DoCmd.OpenForm "FormName", , , currentAppt

The above should open the form to the record that matches the ID on
the form and has the LSNeeded value of greater than 0.
 
Back
Top