Combo Box lookup Text or Number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a problem with a Combo box looking up a record.
I get a error message The OpenForm action was cancelled and the debugger
brings me to this line of code.
DoCmd.OpenForm "DeptUpdate", , , "DeptID = " & Me!Combo14

I’m using this code in other Forms and it works fine
DoCmd.OpenForm "UpdateForm", , , "BoxID = " & Me!Combo36

The only difference between the two lines of code is: DeptID is text and
BoxID is a number could this be the problem? If Yes how do I fix it?
Thanks Terry
 
DoCmd.OpenForm "DeptUpdate", , , "DeptID = '" & Me!Combo14 & "'"

That's a single quote followed by a double quote after the "=", and a single
quote between two double quotes at the end.
 
Back
Top