-
Welcome to the forum- always good to see new members.
It seems to me that the issue is you're not referencing the value of textbox1 correctly in the DLookup function and you're not using the Criteria parameter correctly. Try this:
[vba]Me.Textbox3 = DLookup("Doorvalue", "Doortbl", "FieldName = '" & Me.Textbox1 & "'")[/vba]
In VBA code when you want to refer to an object on the currently active Form, you will need to use the 'Me.' keyword. In the Criteria parameter of the Dlookup function you have to reference the field in the table that you want to use to find the referenced textbox value. Replace 'FieldName' with the name of the actual field in your table. It's a lot like a SQL WHERE clause. You have to use the single quotes to tell dlookup that the value of the referenced textbox is a string data type. If you leave them off the function will fail.
HTH
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules