Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

farcanal (IS/IT--Management) (OP)
14 Sep 06 8:22
Hi
I want to ask the user if they want to exit without saving a form (after making changes to a record). I can get the code to work if I use 'Form_Unload' and close the form using DoCmd.Close. But when I step thru the records using the nav. bar this doesn't work.
I have also tried ...
Private Sub Form_BeforeUpdate(Cancel As Integer)
    If MsgBox("Exit without Saving?", vbYesNo) = vbYes Then
        Exit Sub
    Else
        Cancel = True
    End If
End Sub
This seems to detect a change made on the form and offers the prompt on closing/navigating...but the change made by the user is not ignored .. it is still saved?

Any ideas? - thanks
PHV (MIS)
14 Sep 06 9:05
    If MsgBox("Exit without Saving?", vbYesNo) = vbYes Then
        Cancel = True
    End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886

farcanal (IS/IT--Management) (OP)
14 Sep 06 10:14
Thanks PH - now it doesn't move to the next record.
The MsgBox is displayed - when I select 'Yes' it stays on the record, if I select "no" it moves but the data I have changed is still saved...

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close