An alternative would be to go into the Report's source query, right-click on each of the criteria fields and select BUILD (...) and point it to the form (and the related combo box). The end result would look something like:
[Forms]![myForm]![combo3]
in the criteria field.
Give that a try.
-Silly-
Main Topics
Browse All Topics





by: Jag5x5Posted on 2004-12-19 at 08:45:28ID: 12862222
Where is your module?
What you need to do is on the form you need to go into design mode and go into the properties of your button and on the event tab in the on click property select [Event Procedure] then click on the ... button and this will take you to the VBA editor window.
I would make you Sub look something like this:
Private Sub Command0_Click()
Dim strlinkcrit As String
strlinkcrit = "[fieldname1]= '" & me.[combo3] & "' Or [fieldname2]='" & me.[combo4] & "'"
DoCmd.OpenReport "report1", acViewPreview, , strlilnkcrit
DoCmd.Close acForm, Me.Name
End Sub