Re: complete all the fields before exit
"Carol Shu" <CarolShu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:425BA773-AFF9-4C8D-A18C-BE817833B430@xxxxxxxxxxxxxxxx
that's say I have a form, there are 10 fields in this form, how do I make
user complete all the fields before exit the database, if user only enter
9
fields, the screen will popup a message like "can not exit unless all the
fields are compete.." please help, many thanks.
Put code in the BeforeUpdate event of the Form to validate that none of the
fields are empty or null, if any are, set the Cancel argument to True
(cancels the update event), issue a MsgBox explaining why you are not
allowing the update, and exit.
Larry Linson
Microsoft Access MVP
.
Relevant Pages
- Re: Unable to avoid error message
... since "This SHOULD cancel the BeforeUpdate event and return to the form", you need to do that and exit;) ... ' This SHOULD cancel the BeforeUpdate event and return to the ... Database may have encountered an error while trying to save a record. ... (microsoft.public.access.modulesdaovba) - Record Validation Strategy
... I would like to provide an exit button, ... I could Cancel, but I get an unwanted "Close Action cancelled" message. ... For Each ctl In Me.Controls ... exit sub ... (microsoft.public.access.forms) - Re: Record Validation Strategy
... Private Sub cmdExit_Click ... I would like to provide an exit button, ... I could Cancel, but I get an unwanted "Close Action cancelled" message. ... Dim intResponse As Integer ... (microsoft.public.access.forms) - Re: stop code sending cancelled email
... close the email without sending The cancel triggers error ... "Alex Dybenko" wrote: ... Private Sub Command5_Click ... Exit Sub ... (microsoft.public.access.modulesdaovba) - Re: Cancel Form and Hopelessly Lost Again
... All that setting the Cancel property on the button really does is make ... True cancels the event (stops the user leaving the textbox, ... tidy up events occur - in your case, the textbox exit and, perhaps, others. ... anyway) because the textbox is in a Frame. ... (microsoft.public.word.vba.userforms) |
|