report from form

awake2424

Registered User.
Local time
Today, 03:48
Joined
Oct 31, 2007
Messages
479
Code:
Private Sub Command16_Click()
DoCmd.OpenReport "Patients", , , "Len(Exception & '') > 0"
End Sub

The above code works (thank you pbaldy for your help), but there are only 10 reports as of today. In 3 month there might be 50. Is there a way to use recievedate, which is in the report, as a filter? So when the button is clicked a prompt asking for recievedate, then the records where the recievedate is after the entered date are printed. Or is it possible to print by month? Thank you.
 
It's all possible. To use a date on a form:

DoCmd.OpenReport "Patients", , , "Len(Exception & '') > 0 AND ReceiveDate > #" & Forms!FormName.TextboxName & "#"
 
How does it know what recievedate to use?

DoCmd.OpenReport "Patients", , , "Len(Exception & '') > 0 AND Labeceivedate > #" & Forms!Patients.Labrecievedate & "#"

Thank you.
 
I'm suggesting using a form for the user to enter the date they want used.
 

Users who are viewing this thread

Back
Top Bottom