Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Showing specific records based on two fields

Status
Not open for further replies.

bajanJedi

Technical User
Feb 17, 2004
29
0
0
BB
I had already asked a similar question to this and now was wondering if there is any way to show a specific record (to be the output on a report) based on two fields.

This is the code I have for outputting a specific record based on the ID number -

DoCmd.OpenReport stDocName, acPreview, "", "[PatientID]=[Forms]![frmAppointments]![PatientID]"

I would like to also show not only the specific ID but date as well. Any suggestions?

bajanJedi

 
bajanJedi,
Something like "[PatientID]=[Forms]![frmAppointments]![PatientID] and [AppointmentDate]=[Forms]![frmAppointments]![ApptDate]" should do the trick.

You *may* end up having to surround the date field value with #'s. If you get a "data type error", or "data compare error" or something like that, it will probably mean that you need the #'s.

This report compare value you're working with is essentially just a SQL "Where clause", without the word, "Where", so anything that works in SQL will probably work here, too.

Tranman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top