Cancel Update

B

B F Cole

If you are in the forms update event and with VB logic determine that the
update needs to be cancelled, what is the code?

Example below doesn't seem to work.

Private Sub Form_BeforeUpdate(Cancel As Integer)
if me.date1 < me.date2 then
ianswer=msgbox("Date1 can not be before Date2...correct...",vbcritical)
Cancel = True
me.date1.setfocus ' Go back and correct date
end if

End Sub

Thanks for your always good suggestions,
Bill
 
M

Michel Walsh

Hi,



Me.Undo for all the fields, or Me.ControlName.Undo, for a single field



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top