C
chris.sommerville
Hi All,
I have a form with a command button that has 2 combo boxes beside it.
The 2 comboboxes and named cmbYear (number field from a query) and
cmbMonth( text field from a month table tblMonth).
The coding for the command button is
Private Sub Command5_Click()
DoCmd.OpenReport "2007_SWR Query", acViewPreview, , "[Costing Month]
='" & Me.cmbMonth & "' AND [Year] = " & Me.cmbYear
End Sub
Issue I am having is that it will accept the cmbmonth value but
prompts me for the year value.
If I cancel the prompt and debug the line, on mouse over the correct
value for me.cmbyear is displayed.
If I don't cancel the prompt and put in the correct year the
docmd.openreport works fine.
Any ideas of why it isn't accepting the Year value in the WHERE?
Regards
Chris Sommerville
I have a form with a command button that has 2 combo boxes beside it.
The 2 comboboxes and named cmbYear (number field from a query) and
cmbMonth( text field from a month table tblMonth).
The coding for the command button is
Private Sub Command5_Click()
DoCmd.OpenReport "2007_SWR Query", acViewPreview, , "[Costing Month]
='" & Me.cmbMonth & "' AND [Year] = " & Me.cmbYear
End Sub
Issue I am having is that it will accept the cmbmonth value but
prompts me for the year value.
If I cancel the prompt and debug the line, on mouse over the correct
value for me.cmbyear is displayed.
If I don't cancel the prompt and put in the correct year the
docmd.openreport works fine.
Any ideas of why it isn't accepting the Year value in the WHERE?
Regards
Chris Sommerville