I have an entry form. On the save click i validate the data entered against teh data from another query. In order to access that query from within the form what techniques are available?
If anyone could give me a sample code, I'd be thankful!
If anything includes embedded spaces, enclose it within square brackets (eg "[Last Name]".
If successful, DLookup will return the value of Field1 into varName. Field1 would need to be a field in your query.
QueryName is just the name of the query you want to search.
Criteria is like an SQL WHERE clause without the WHERE. As an example, assume you are looking for a query field called last name = "Smith" and that "Smith" is the value from a form text box called txtLastName. The criteria part would look like this: "[Last Name] = '" & txtLastName & "'". Note the single quotes around the textbox value. If you are using numeric data, remove them. If you are using date data, replace them with #.
So using our above example, here is how it would look:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.