Full Version: Form_BeforeUpdate
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
access2009eg
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.text0) Then
MsgBox "complete data"
Cancel = True
End If
End Sub

why the msgbox above appear to me twice?
I click the message box 2 time until disappear
what is the reason
thanks
missinglinq
No idea, based on your posted code, unless the control is corrupted. It runs as expected when I recreate your scenario in v2003. You might delete the textbox and BeforeUpdate event and recreate them.
ChrisO
G’day Aam.

Do you mean you get one message box when you try to move to a new record and another message box when you try to close the Form?

Regards,
Chris.
HiTechCoach
Is there any other VBA code on the form?
access2009eg
missinglinq
ChrisO
HiTechCoach
Thanks all
HiTechCoach
Is there any other VBA code on the form?
I find the trick you give the idea
i duplicate the code here is the duplication
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec
the message appear twice for the above reason

thumbup.gif thumbup.gif thumbup.gif
access2009eg
if find answer for duplicating message by help HiTechCoach but Now

if i have the above code and this message appear to me when closing the form how can i prevent this message from appear?


i'm using this code to close the form
command_1_click
docmd.close
end sub
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.