dlookup?

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.
 
G

Gary Miller

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

Top