dlookup?

  • Thread starter Thread starter Ernst Guckel
  • Start date Start date
E

Ernst Guckel

Hello,

I have a combobox whos row source = StateID;StateName

in code in the ZipCode_Exit event I have the following:

Me.cboState.Value = DLookup("[StateID]", "tblTypeState", "[StateName] =" &
StateLookup())

StateLookup looks up the state in the database. It returns the correct
info. Am I missing something?

Ernst.
 
You are missing a couple of single quotes if the StateName
is a text value.

Me.cboState.Value = DLookup("[StateID]", "tblTypeState",
"[StateName] = '" &
StateLookup() & "'")

Gary Miller
 
Back
Top