Private Sub REPORT_Click()
Dim strRegNo As String
Dim strADSB As String
Dim strFilter As String
If IsNull(Me.Text0.Value) Then
strRegNo = "Like '*'"
Else
strRegNo = "='" & Me.Text0.Value & "'"
End If
If IsNull(Me.Text2.Value) Then
strADSB = "Like '*'"
Else
strADSB = "='" & Me.Text2.Value & "'"
End If
strFilter = "[RegNo] " & strRegNo & " AND [AD/MSB NO] " & strADSB
' With Reports![ADSB REG]
' .Filter = strFilter
' .FilterOn = True
' End With
DoCmd.OpenReport "ADSB REG", acViewPreview,,strFilter
Me.Text0.Value = Null
Me.Text2.Value = Null
End Sub
|