Not sure if this is in the right forum but here goes.
I have a form for entering customer and job details (form1) which work fine.
What i cant figure out is a couple of simple message boxes.
The first field on the form is a "name" textbox. What i want to happen is if the name field is empty and the user presses enter or tab to get to the next field i want a message box to pop up saying that "name is required"(Msgbox1).
If the user enters a name that already exists in the customers table then i want another message box to pop up saying that the name already exists, and when the user clicks ok they are taken back to an empty name field.
I`ve trawled through all the posts i can find but none of them seem to be what i need (and im not clever enough to modify the code myself) or the ones that do seem to be what i want i cant get to work.
Ive tried putting code in the Afterupdate, Beforeupdate and the lost focus event of the name field.
Sorry for the long post and thanks in advance for your help.
I have a form for entering customer and job details (form1) which work fine.
What i cant figure out is a couple of simple message boxes.
The first field on the form is a "name" textbox. What i want to happen is if the name field is empty and the user presses enter or tab to get to the next field i want a message box to pop up saying that "name is required"(Msgbox1).
If the user enters a name that already exists in the customers table then i want another message box to pop up saying that the name already exists, and when the user clicks ok they are taken back to an empty name field.
I`ve trawled through all the posts i can find but none of them seem to be what i need (and im not clever enough to modify the code myself) or the ones that do seem to be what i want i cant get to work.
Ive tried putting code in the Afterupdate, Beforeupdate and the lost focus event of the name field.
Sorry for the long post and thanks in advance for your help.