J
Jeff
Hi,
I have a TextBox that has an Input Mask.
So when the focus leaves the TextBox, if the format of the
data is invalid a msgbox will display saying that the
format is invalid. Which is ok.
However when you Close out of the Form (Click on the X to
close), if the data is still invalid in that TextBox the
Invalid Msgbox will still appear. I don't want that to
happen.
Here are some of things I tried, none of which do what I
want done...
I know you can trap the Error in
Private Sub Form_Error(DataErr As Integer, Response As
Integer)
But if I trap it, it will also "trap" when user leaves the
focus of the TextBox. Again I want the msgbox to appear
when user exits TextBox but NOT when user exits the Form,
to just ignore that the data is invalid & close.
I also tried on the Exit Event, Lost Focus Event, & the
AfterUpdate Event of the TextBox but again the same thing
happens. Those Events are triggered when user Click on
the X to close out the Form. So if I put logic there to
say the data is invalid, it will then also pop up when
user closes out of the form, which I dont want to happen.
In EXCEL VBA there is an QueryClose Event of the Form,
where it would work there, it doesnt trigger the Exit,
LostFocus, or After Update Events of controls. However
this Event doesn't exist in Access (I already posted a
question on this).
So is their something similar ?
Or any way I can get a Form to close with ignoring the
controls ?
Any help would be greatly appreciated.
Thank you very much,
Jeff
I have a TextBox that has an Input Mask.
So when the focus leaves the TextBox, if the format of the
data is invalid a msgbox will display saying that the
format is invalid. Which is ok.
However when you Close out of the Form (Click on the X to
close), if the data is still invalid in that TextBox the
Invalid Msgbox will still appear. I don't want that to
happen.
Here are some of things I tried, none of which do what I
want done...
I know you can trap the Error in
Private Sub Form_Error(DataErr As Integer, Response As
Integer)
But if I trap it, it will also "trap" when user leaves the
focus of the TextBox. Again I want the msgbox to appear
when user exits TextBox but NOT when user exits the Form,
to just ignore that the data is invalid & close.
I also tried on the Exit Event, Lost Focus Event, & the
AfterUpdate Event of the TextBox but again the same thing
happens. Those Events are triggered when user Click on
the X to close out the Form. So if I put logic there to
say the data is invalid, it will then also pop up when
user closes out of the form, which I dont want to happen.
In EXCEL VBA there is an QueryClose Event of the Form,
where it would work there, it doesnt trigger the Exit,
LostFocus, or After Update Events of controls. However
this Event doesn't exist in Access (I already posted a
question on this).
So is their something similar ?
Or any way I can get a Form to close with ignoring the
controls ?
Any help would be greatly appreciated.
Thank you very much,
Jeff