Runtime 3057 Error on a dlookup

Locopete99

Registered User.
Local time
Today, 11:01
Joined
Jul 11, 2016
Messages
163
Hi,

I'm getting a runtime 3057 error on the below Dlookup code.

Code:
Month = DLookup("Month 12", "Tbl_Forecast", "[Subba2]=" & "'" & [Subba] & "'")

Both Month 12 , Subba2 and Subba are text fields.

I'm trying to use the code to find the date that is saved for Month 12 on Tbl_Forecast. Where the Subba2 (Sub blanket agreement) matches the Subba on the main form.

I want to use this to work out how much longer the subba will be valid.


the Error message says
"Syntax error (missing operator) in query expression Month 12."

I've checked that the field name and table names are spelled exactly the same and I'm now at a loss.
 
Also your result variable name of Month - is a reserved word, call it something else or you will probably get other errors creeping in.
 

Users who are viewing this thread

Back
Top Bottom