»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 03-30-2004, 09:32 AM   #1 (permalink)
Registered User
 
Join Date: Jul 2003
Posts: 7
MushMouse is on a distinguished road
Systems Access VBA - Don't want form to close if null

If a user clicks the x in the upper right corner to close a form with a required field & the field is null, Access prints a message saying "You can't save this record at this time"

Is there any way to customize this message?

My table has required set to true, & an appropriate message.

I've tried using Form Before Update. But it seems to bypass this & displays the table required message & prints "You can't save this record at this time..." afterwards

When I use Form__Error I can eliminate the unwanted messages, but the form then closes before the user is given an opportunity to correct the problem. Is there a way to tell Form_Error to remain in the form, rather than continuing with the user's request, which in this case, is to close the form?

Any help would be much appreciated!!

MushMouse is offline   Reply With Quote
Old 03-30-2004, 09:37 AM   #2 (permalink)
Guest
Guest
 
Posts: n/a
Can't use point Form_Error at an error handling function? I think that's what I used to do. It's been a couple years though.

We'll see how long till vass sees this, he'll know.
  Reply With Quote
Old 03-30-2004, 09:38 AM   #3 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
I can't remember, but you should be able to get rid of the X method to close a form.
Once you get rid of it, put a button specific to closing the form, and put necessary code to check if its NULL.

Not sure if it works in Access, but also try to create a procedure called

Public Sub FormName_Unload(cancel as integer)
If input = blank then
cancel = 1
end if
End Sub

If its like VB, this method will be called as the form closes.
If its set to cancel = 1 it will cancel the unload, you can then also include necessary error handling.
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Old 03-30-2004, 01:32 PM   #4 (permalink)
Registered User
 
Join Date: Jul 2003
Posts: 7
MushMouse is on a distinguished road
Unfortunately, the users want to close their form using the standard x in the upper right corner.

I tried the unload procedure, but the form still closed afterwards.

Any other suggestions?
MushMouse is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 02:21 PM.