Do Lookup - if exists, do this, if does not exist, do that...
Posted on 2004-11-17
I have a form called frmMain.
I have a table called Engineers.
On my form, if a user enters an engineer number, I'd like the after_update event to check a couple of things - there are 3 fields, one called 'Engineer number', andother called 'End date' and another called 'mobile'. If 'End date' is null, and if 'Engineer number' exists, then I'd like the 'mobile' number inserted into a field called 'Engtel' on my form.
If the 'Engineer number' does not exist, I'd like a msgbox "does not exist".
If the 'End date' is not null, then a msgbox "Engineer terminated on " & [End date].
Easy enough? I'm just getting to grips with Dlookups, but there are a few variables in my criteria that I can't seem to place correctly. Can anyone assist?