Link to home
Create AccountLog in
Avatar of TimHudspith
TimHudspith

asked on

Dlookup syntax in ControlSource property of a textbox

I can't seem to get the syntax right when using a Dlookup as the control source of a text box on an Access form. It references the value in a combobox on the same form.

=Dlookup("Field2", "MyTable", "Field1 = '" & Me.cmbName.value & "'")

This works in VBA but not when placed in the ControlSource property of textbox when the form is in design view.
ASKER CERTIFIED SOLUTION
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account