I have a form where I can open the report specifically with the (open) record and it works well
Private Sub btnIncPreview_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[IDEvent] = " & Me.[IDEvent]
DoCmd.OpenReport "RptEvent", acViewReport, , strWhere
End If
End Sub
I have another form where I want to enter in a box the IDEvent and open the report
So I have a combo box (I might only need a text box with Number format) SearchBoxEventID
Row Source query for IDEvent and btnEventReport with the vba
Dim strWhere As String
If Not IsNull(Me.SearchBoxEventID) Then
strWhere = "IDEvent = " & Me.SearchBoxEventID (I also tried "Forms!frmEvent!IDEvent = but no)
End If
DoCmd.OpenReport "RptEvent", acViewReport, , strWhere
the form frmEvent is not open at the time of this happening if it is the report opens but at the first ID no not the one i select
any clues anyone