Greetings,
I have a form that derives it's data from a query with criteria [Type
Arrival Date]. I have a report that is opened with a command button from
the form with the following code on the On Click event:
Private Sub cmdPrintArrivals_Click()
On Error GoTo Err_cmdPrintArrivals_Click
Dim stDocName As String
stDoc = "rptGuestArrivals"
stCriteria = "ID = " & Me.ID
DoCmd.OpenReport stDoc, acNormal, , stCriteria
Exit_cmdPrintArrivals_Click:
Exit Sub
Err_cmdPrintArrivals_Click:
MsgBox Err.Description
Resume Exit_cmdPrintArrivals_Click
End Sub
Can anyone tell me how I make it so the report takes the criteria from the
form without the criteria pop-up appearing when the report is opened from
the command button? The form and the report both use the same query.
Thanks,
Scott B
Duane Hookom - 11 Jul 2005 05:13 GMT
Don't use parameter prompt queries. Replace them with references to values
of controls on forms. Martin Green has some good tips on how to do this at
http://www.fontstuff.com/access/index.htm.

Signature
Duane Hookom
MS Access MVP
> Greetings,
>
[quoted text clipped - 26 lines]
> Thanks,
> Scott B