[mso] Re: Access 2002: Checking For Nulls On Form Close

  • From: Cathy.Evans@xxxxxxxxx
  • To: mso@xxxxxxxxxxxxx
  • Date: Wed, 16 Jun 2004 10:19:14 -0400

Trying to work out the last problem in getting this form correct, moved the
code to the form unload property:

Private Sub Form_Unload(Cancel As Integer)
    If Nz(Me!Description, "") = "" Then
        MsgBox "Please fill in Package Description!", vbOKOnly +
vbExclamation, "Must Complete Information!"
        Me!Description.SetFocus
        Cancel = True
        Me.Undo
        Exit Sub
      End If
etc., same, etc., for the other fields ...

Have tried adding set warnings on/off so the 'The close action was
canceled' message box will not pop up after "Please fill in _________!"
message box appears when form is closed and field is blank.  But doesn't
seem to shut if off.  Why does it close properly if user closes form using
'x' to close, but if they use the 'next' or 'home' button, which has
DoCmd.Close, then  'The close action was canceled' box pops up after MsgBox
message.  Can I use another close method that will mimic closing with 'x'
or is there another method besides set warnings that will work?

Hope I'm explaining it right, thank you for all the help already provided
in this one!  Thank you, Cathy



-----------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential
and/or privileged material. If you are not the intended recipient 
of this message you are hereby notified that any use, review,
retransmission, dissemination, distribution, reproduction or any
action taken in reliance upon this message is prohibited. If you 
received this in error, please contact the sender and delete the 
material from any computer.  Any views expressed in this message
are those of the individual sender and may not necessarily reflect 
the views of the company.  
-------------------------------------------------------------------------------------------------------

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: