Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dlookup using a text field 1

Status
Not open for further replies.

cimoli

Technical User
Jul 30, 2010
207
0
0
US
I have a query with the following dlookup field.
i need the flcminorName to be retrieved based on the text field flcIDminor that is
in tblflccombined. (I realize that i should not have used "ID' in the word flcIdminor
but at first, i was told incorrectly that the field was a number but really my friend
started many minor codes to start with a zero. bad, but it was too late for me to fix the field name.)

I get #error so i am doing something wrong in this dlookup.
again, flcIDminor is a text field.

Minorname: DLookUp("FlcMinorName","tblFlcCombined","FlcidMinor=" & [FlcidMinor] & "'")
 
I typically don't care for using domain aggregate functions in queries, however add a single quote to match the ending single quote. All of your quotes must be in pairs.

Minorname: DLookUp("FlcMinorName","tblFlcCombined","FlcidMinor=[highlight #FCE94F]'[/highlight]" & [FlcidMinor] & "'")

Duane
Hook'D on Access
MS Access MVP
 
Duane - You were right. I finally figured out why my oldie query stopped working correctly.
It did not need a new Dlookup. Just as you thought.

In the table tblFlccombined, I temporarily took off the 2 keys, major and minor.
I was adding some info 'add hock' and figured that i would add the 2 keys back when done.
But I Forgot !!

Hence, I doubled up on some records.

You were correct to think it odd to use the dlookup in my case. thanks for making me see it eventually.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top