Help with code for closing (1 Viewer)

kirsty

Registered User.
Local time
Today, 06:20
Joined
Nov 5, 1999
Messages
19
Hi,

I have written some code to ensure that data entry of a field is mandatory and if the user tries to close the form a message box displays to warn the user that this info, is missing, however, the form still closes.

Does anyone know how to actually stop the form closing until this info. is filled in?

Thanks,
Kirsty.
 

DMC

Registered User.
Local time
Today, 06:20
Joined
Dec 6, 1999
Messages
23
Try something like this:

If is null(Yourcontrol.value) Then Goto Stop_Closing_Form Else

Docmd.close

Exit sub

Stop_Closing_Form:
msgbox your message
exit sub

if you insert something like this in the on click property of your close button that should prevent them leaving a null value in your control
 

Users who are viewing this thread

Top Bottom