Reports based on queries w/ WHERE clauses
- From: Pat Dools <PatDools@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 27 Jul 2009 05:26:01 -0700
I am struggling with launching reports from behind a Command button on a form
where a query with a WHERE clause is involved. Launching the report from the
Database Window is no problem, but somehow putting the right code behind a
button is preventing the report from launching with data showing properly.
Here is a sample of some code I'm using that is not working:
Private Sub CommandOpenVisitPerSession_Click()
DoCmd.OpenReport "rVisit_Per_Session", acViewPreview, "q_Visit_Per_Session",
"Visit_Date between [Begin Date] and [End Date] and Session_ID =1"
End Sub
I am just about ready to release this version (not the final one yet) but I
can't do so until they can use the 'Reporting Switchboard' properly. Thank
you in advance, I've been searching for examples of how to do this, but none
quite match what I'm doing. In the above example, I need the user to get
prompted for a date range that [Visit_Date] falls in and where [Session_ID] =
1.
Thank you!
.
- Follow-Ups:
- RE: Reports based on queries w/ WHERE clauses
- From: Duane Hookom
- RE: Reports based on queries w/ WHERE clauses
- Prev by Date: Problem with Count/filter?
- Next by Date: RE: Transpose data in a report-Field values broken down to separat
- Previous by thread: Problem with Count/filter?
- Next by thread: RE: Reports based on queries w/ WHERE clauses
- Index(es):
Loading