T
Tony Williams
I'm getting a syntax error with this code. can anyone see what I am doing
wrong?
Private Sub cmdok_Click()
Dim strform As String 'Name of report to open.
Dim strField As String 'Name of your date field.
Dim strWhere As String 'Where condition for OpenReport.
strform = "frmFDAfindb"
strField = "txtmonthlabel"
strWhere = strField & "#" & Me![txtdate] & "#"
If Not IsNull(Me.cmbselectcompany) Then
strWhere = strWhere & " AND txtcompany = """ & Me.cmbselectcompany & """"
End If
DoCmd.OpenForm strform, acNormal, , strWhere
End Sub
Thanks
tony
wrong?
Private Sub cmdok_Click()
Dim strform As String 'Name of report to open.
Dim strField As String 'Name of your date field.
Dim strWhere As String 'Where condition for OpenReport.
strform = "frmFDAfindb"
strField = "txtmonthlabel"
strWhere = strField & "#" & Me![txtdate] & "#"
If Not IsNull(Me.cmbselectcompany) Then
strWhere = strWhere & " AND txtcompany = """ & Me.cmbselectcompany & """"
End If
DoCmd.OpenForm strform, acNormal, , strWhere
End Sub
Thanks
tony