Criteria in DCount

padlocked17

Registered User.
Local time
Today, 06:36
Joined
Aug 29, 2007
Messages
275
Good EVening -

I need to set the criteria in a DCount to make a column = "CurrentFEVersion" in my options table but I'm not sure how to reference it.

Does anyone have any suggestions?

Thanks!

Code:
strFEMaster = DLookup("OptionValueTxt", "tblOptions", [OptionType] = "CurrentFEVersion")
 
Try:
Code:
'This assumes your variable CurrentFEVersion  is a String
strFEMaster = DLookup("OptionValueTxt", "tblOptions", "[OptionType] ='" & CurrentFEVersion &"'")

'This assumes your variable is numeric of some kind (integer or long)
strFEMaster = DLookup("OptionValueTxt", "tblOptions", "[OptionType] =" & CurrentFEVersion )
 
Turned out I needed to use:

Code:
DLookup("OptionValueTxt", "tblOptions", "OptionType = 'CurrentFEVersion'")
 

Users who are viewing this thread

Back
Top Bottom