Hey guys -
In my existing, I take a beginning and end date obtained from two text box controls, then use this information to build a report. The code is seen below.
I'm trying to incorporate a combobox named cboVehicle so the user can also select either a single vehicle, or all vehicles as it currently does, to build this report. The combobox values are based off the same table "tblOdometer".
However, when I run this code, I receive the error:
Run-time error '2465'
database name can't find the field '|1' referred to in your expression.
Any ideas?
Furthermore, how would I make the combobox optional, or somehow default the option for all vehicles?
In my existing, I take a beginning and end date obtained from two text box controls, then use this information to build a report. The code is seen below.
I'm trying to incorporate a combobox named cboVehicle so the user can also select either a single vehicle, or all vehicles as it currently does, to build this report. The combobox values are based off the same table "tblOdometer".
However, when I run this code, I receive the error:
Run-time error '2465'
database name can't find the field '|1' referred to in your expression.
Any ideas?
Furthermore, how would I make the combobox optional, or somehow default the option for all vehicles?
Code:
DoCmd.OpenReport ReportName:="rptMileageHistory", View:=acViewPreview, _
WhereCondition:="[Odate] Between #" & Format(Me.txtBegin, "mm\/dd\/yyyy") & _
"# And #" & Format(Me.txtEnd, "mm\/dd\/yyyy") & "#"