Get rid of Default Access warning msgbox ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a form open & have a Text Box that has an "Input Mask". If a user enters invalid data for that text box, a defualt Access Msgbox comes up saying that it is invalid

I know how to stop this; by using the Private Sub Form_Error(DataErr As Integer, Response As Integer
captuiring the Err # & setting the "Response = acDataErrContinue", which works

However this is where I need help on..

If the data is invalid, & the user Clicks on the X to close out the form, the following Access Warning Msgbox appears..

"Microsoft Access may have encountered an arror while trying to save a record. If you close this object now, the data changes you made will be lost. Do you want to close the database object now ?" (with Yes / No buttons

I want to get rid of this so Access will NOT display this. To either keep the form open or just close it down, but not to display this forcing the user to click on Yes or No

I tried: DoCmd.SetWarnings False which doesnt work

Is their any way to get rid of this

Any help would be greatly appreciated

Thank you
Jef
(e-mail address removed)
 
The other msg also fires Form_Error.

Add a: MsgBox DataErr to see.

Then just trap that extra error & set Response accordingly.

HTH,
TC


Jeff said:
Hi,

I have a form open & have a Text Box that has an "Input Mask". If a user
enters invalid data for that text box, a defualt Access Msgbox comes up
saying that it is invalid.
I know how to stop this; by using the Private Sub Form_Error(DataErr As Integer, Response As Integer)
captuiring the Err # & setting the "Response = acDataErrContinue", which works.

However this is where I need help on...

If the data is invalid, & the user Clicks on the X to close out the form,
the following Access Warning Msgbox appears...
"Microsoft Access may have encountered an arror while trying to save a
record. If you close this object now, the data changes you made will be
lost. Do you want to close the database object now ?" (with Yes / No
buttons)
I want to get rid of this so Access will NOT display this. To either keep
the form open or just close it down, but not to display this forcing the
user to click on Yes or No.
 
Hi TC,

Yes you are right, it worked ! Thank you so much !!

Just in case for that msg the Error # is 2169.

Thnx again,
Jeff
 
I have a form open & have a Text Box that has an "Input Mask". If a
user enters invalid data for that text box, a defualt Access Msgbox
comes up saying that it is invalid.

I thought the whole point of an input mask was to physically prevent any
user from entering any invalid keystrokes. Where are these invalid data
coming from?
I know how to stop this; by using the Private Sub Form_Error

Well, what about using the "normal" method of trapping validation errors,
with the txtTextBox_BeforeUpdate event? This way you can avoid all error
messages, and just get the data right.

B Wishes


Tim F
 
Back
Top