Hi,
I am trying to open a report based on a combo box value but cannot get it to work. The following code works;
DoCmd.OpenReport "rpt1", acViewPreview, , "[CallReasonCode]='SS'"
or
DoCmd.OpenReport "rpt1", acViewPreview, , "[CallReasonCode]='VM'"
but when I take the value from the combo box as follows it does not;
Dim strCode As String
strCode = Me.cmbTest
DoCmd.OpenReport "rpt1", acViewPreview, , "[CallReasonCode]=" & strCode
The combo box is based on a table of call reason codes. The report is based on a query of calls which contain the call reason code.
can anyone see my error
thanks
I am trying to open a report based on a combo box value but cannot get it to work. The following code works;
DoCmd.OpenReport "rpt1", acViewPreview, , "[CallReasonCode]='SS'"
or
DoCmd.OpenReport "rpt1", acViewPreview, , "[CallReasonCode]='VM'"
but when I take the value from the combo box as follows it does not;
Dim strCode As String
strCode = Me.cmbTest
DoCmd.OpenReport "rpt1", acViewPreview, , "[CallReasonCode]=" & strCode
The combo box is based on a table of call reason codes. The report is based on a query of calls which contain the call reason code.
can anyone see my error
thanks