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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Combobox Lookup 3
Combobox Id 4
Why does this code work? 4
Show Selected Item in Combo Box 1
criteria problem 6
Find record based on PK in Subform 1
Combo Box Help 5
Three cascading comboboxes - how to code 2

Back
Top