combo box error message

thierry14

New member
Local time
Yesterday, 19:09
Joined
Jun 2, 2006
Messages
7
Can anyone tell me whats wrong with this line of code?

DoCmd.OpenReport "rptOverview", acViewPreview, , "WHERE [CarID] = " & Me.cboCar.Value

I'm getting a missing operator error (3075)

..its supposed to open a report based on what record the user selected from a combo box

thanks
 
WhereCondition Optional Variant. A string expression that's a valid SQL WHERE clause without the word WHERE.
 
Error in Open Statement

Your statement should read

DoCmd.OpenReport "rptOverview", acViewPreview, , "[CarID] = " & Me.cboCar

1. You can't use word "WHERE" , just use the qualifier [CarID] = and the value
2. I presume cboCar is a Combo box and it is bound to one of the column. Its value is JUST Me.cbocar and NOT Me.cboCar.Value - error 3075
Mark
 

Users who are viewing this thread

Back
Top Bottom