I'm trying to use a DLookup in Access VBA, but even with a criteria (hard-coded or from a text box), the lookup only returns the value from the first record in the table, not a record that matches the criteria.
Here is my code;
JOBID = DLookup("[ID]", "[MASTER PLANNER]", "[JOB NUMBER] = '" & Me.JOB_NUMBER & "'")
ID is a numerical ID field, [JOB NUMBER] is a string (like this; S019191-1) and JOB_NUMBER is the field on the form.
Anyone have any ideas on this at all?
Thanks!