VB Dlookup Run-time error

hece99

New member
Local time
Today, 10:19
Joined
Dec 19, 2017
Messages
5
Hi! Hopefully someone can help me out. I am having trouble with adding dlookup afterupdate.

I have combo box (DescriptionCombo) when selected I need the Template to appear in the text box (Template). The information is stored in the DescriptionPriceTemplates table. Both the description and template have text, numbers and dashes.

Here's my code:
[Template] = DLookup("[Template]", "[DescriptionPriceTemplates]", "[Description]='" & [DescriptionCombo])
 
Count your quotes. They should all come in pairs.

Extra hint--you have two types of quotes in there.
 
Description field sounds like a string. You need surrounding quotes for strings.

DLookup("[Template]", "[DescriptionPriceTemplates]", "[Description]='" & [DescriptionCombo] & "'")
 
wow, hard to guess, another clue plz.
 
The real question is, why do a text search on a table that should have an ID?
 

Users who are viewing this thread

Back
Top Bottom