R
rkg
I'm having trouble with printing a report. The report prints records
based on the name I select in a combo box and works great. I am trying
to get the same report to print base on a date selected in the combo
box. I've set the combo box to the date field called(entry_date) in
the query and changed the code to accept the date value instead of the
name but get errors each time.
Here is the code
Private Sub Combo7_AfterUpdate()
Dim strCriteria As String
strCriteria = "[entry_date] = """ &
Me.Combo7 & """"
If Not IsNull(DLookup("[entry_date]",
"qscale08", strCriteria)) Then
DoCmd.OpenReport "rscaletickets08",
WhereCondition:=strCriteria
Else
MsgBox "Name not found", vbInformation,
"Warning"
End If
End Sub
There seems to be some sort of data type mismatch. I know it's
something simple but just can't seem to get it. Could it be because
of the strCriteria As String?
Any help would be appreciated.
Thanks,
rkg
based on the name I select in a combo box and works great. I am trying
to get the same report to print base on a date selected in the combo
box. I've set the combo box to the date field called(entry_date) in
the query and changed the code to accept the date value instead of the
name but get errors each time.
Here is the code
Private Sub Combo7_AfterUpdate()
Dim strCriteria As String
strCriteria = "[entry_date] = """ &
Me.Combo7 & """"
If Not IsNull(DLookup("[entry_date]",
"qscale08", strCriteria)) Then
DoCmd.OpenReport "rscaletickets08",
WhereCondition:=strCriteria
Else
MsgBox "Name not found", vbInformation,
"Warning"
End If
End Sub
There seems to be some sort of data type mismatch. I know it's
something simple but just can't seem to get it. Could it be because
of the strCriteria As String?
Any help would be appreciated.
Thanks,
rkg