Help with DLOOKUP

TasCat09

New member
Local time
Today, 12:54
Joined
Aug 7, 2016
Messages
10
Hello

Can somebody help me understand why the top line of code works OK but the second doesn't?

recID = DLookup("[ID]", "RECIPES", "RecipeName = 'chow mein'")

recID = DLookup("[ID]", "RECIPES", "RecipeName = '" & Me.txtRecipe & "')"

Where txtRecipe is a text box on the current form that's value is 'chow mein'
 
Try:
recID = DLookup("[ID]", "RECIPES", "RecipeName = '" & Me.txtRecipe & "'")
 
Thanks Stopher

That worked like a charm. I also had success with the following:

recID = DLookup("[ID]", "RECIPES", "RecipeName = '" & Me.txtRecipe & "'")
 

Users who are viewing this thread

Back
Top Bottom