Hey everyone...
I have a report with 4 labels on it at the top. The first label is lblSunday1, the second is lblSunday2, and so forth...
I have a small form in my Database called frmReports. On this form I have cmbMonths, cmbYears, and cmbDates.
If I select June from cmbMonths and 2008 from cmbYears, all of the Sundays for that month and year are populated into cmbDates (column(1), column(2), column(3), and column(4)).
Here's my trouble...I have in my Rport On Open VBA code this...
[CODE=VB]Private Sub Report_Open(Can cel As Integer)
lblSunday1.Capt ion = Forms!frmReport s!cmbDates.Colu mn(1)
lblSunday2.Capt ion = Forms!frmReport s!cmbDates.Colu mn(2)
lblSunday3.Capt ion = Forms!frmReport s!cmbDates.Colu mn(3)
lblSunday4.Capt ion = Forms!frmReport s!cmbDates.Colu mn(4)
DoCmd.Maximize
End Sub [/CODE]
However, I get an error when I try to open the report filtering to those specific cmbDates values.
Error: DataType Mismatch
What am I doing wrong?
Thanks!
I have a report with 4 labels on it at the top. The first label is lblSunday1, the second is lblSunday2, and so forth...
I have a small form in my Database called frmReports. On this form I have cmbMonths, cmbYears, and cmbDates.
If I select June from cmbMonths and 2008 from cmbYears, all of the Sundays for that month and year are populated into cmbDates (column(1), column(2), column(3), and column(4)).
Here's my trouble...I have in my Rport On Open VBA code this...
[CODE=VB]Private Sub Report_Open(Can cel As Integer)
lblSunday1.Capt ion = Forms!frmReport s!cmbDates.Colu mn(1)
lblSunday2.Capt ion = Forms!frmReport s!cmbDates.Colu mn(2)
lblSunday3.Capt ion = Forms!frmReport s!cmbDates.Colu mn(3)
lblSunday4.Capt ion = Forms!frmReport s!cmbDates.Colu mn(4)
DoCmd.Maximize
End Sub [/CODE]
However, I get an error when I try to open the report filtering to those specific cmbDates values.
Error: DataType Mismatch
What am I doing wrong?
Thanks!
Comment