D
Don Barton
I am using MS Access 2007 with Vista home premium
The user selects a value (string) from a combobox. Hitting tab to the
next control fires an on Got Focus event.
Dim TestMnem As String, TestName As Variant
TestMnem = Me.[LOTestMnemonic]
TestName = DLookup("[LabTestName]", "tblLabTests", "[LabTestMnemonic]
= " & TestMnem)
Me.LOTestName = TestName
TestMnem returns the desired string value as selected on my form. Let
say it is "CHEMSC"
Next I use this the variable TestMnem in the DLookup criteria
expression above.
I get the following error each time: "The expression you entered as a
query parameter produced this error: *value of TestMnem*
From everything I've looked at this should work. If I change
"[LabTestMnemonic] = " & TestMnem) to "[LabTestMnemonic] =
'CHEMSC'"), the event works correctly.
Don
LabDBDesigns
The user selects a value (string) from a combobox. Hitting tab to the
next control fires an on Got Focus event.
Dim TestMnem As String, TestName As Variant
TestMnem = Me.[LOTestMnemonic]
TestName = DLookup("[LabTestName]", "tblLabTests", "[LabTestMnemonic]
= " & TestMnem)
Me.LOTestName = TestName
TestMnem returns the desired string value as selected on my form. Let
say it is "CHEMSC"
Next I use this the variable TestMnem in the DLookup criteria
expression above.
I get the following error each time: "The expression you entered as a
query parameter produced this error: *value of TestMnem*
From everything I've looked at this should work. If I change
"[LabTestMnemonic] = " & TestMnem) to "[LabTestMnemonic] =
'CHEMSC'"), the event works correctly.
Don
LabDBDesigns