By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,529 Members | 1,860 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,529 IT Pros & Developers. It's quick & easy.

Save Prompt issue between sub-forms

P: n/a
am using the following script in the BeforeUpdate area of a main form.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Do you wish to save your changes?"
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes
Then
'do nothing
Else
On Error Resume Next
Application.Echo (False)
Me!sfrmAddress.SetFocus
DoCmd.RunCommand (acCmdUndo)
Application.Echo (True)
'Me!RolodexNew.SetFocus
'DoCmd.RunCommand (acCmdUndo)
End If
End Sub

The script works great but it's very repetitive. In the main form I
have include two sub-forms. Everytime the user switches between forms
the script prompts them to save. Which works. I am no sure if I need
to just move the script into a different Event or not.

What I would like to do is for a user to make all the edits they need
in the main form including all the sub-forms and when they move to a
new record or leave the main form it prompts/saves the changes to main
form and sub-forms. As you can see, if they cancel the save, it undoes
all their changes prior to the save. Is that function still possible
while moving through sub-forms. So, if they make changes in both
sub-forms and then decide they don't want them, is their a script that
will allow me to undo all entries?

Thanks...any help would be appreciated.

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I'm continually confused by application designs that ignore and/or work
around the default Access behavior to opportunistically save records when a
form is closed, movement to new/next record, etc. Users can always press
<Esc> (before moving off the form) to undo all data entry edits. Confirm
dialogs for deletions and global updates make sense, but a confirm for each
record add/edit has always struck me as annoyingly tedious. Why not accept
the default "save" and add a "cancel" button if you still think you need
one?
-Ed

"icedgar" <dg******@dreamworks.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
am using the following script in the BeforeUpdate area of a main form.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Do you wish to save your changes?"
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes
Then
'do nothing
Else
On Error Resume Next
Application.Echo (False)
Me!sfrmAddress.SetFocus
DoCmd.RunCommand (acCmdUndo)
Application.Echo (True)
'Me!RolodexNew.SetFocus
'DoCmd.RunCommand (acCmdUndo)
End If
End Sub

The script works great but it's very repetitive. In the main form I
have include two sub-forms. Everytime the user switches between forms
the script prompts them to save. Which works. I am no sure if I need
to just move the script into a different Event or not.

What I would like to do is for a user to make all the edits they need
in the main form including all the sub-forms and when they move to a
new record or leave the main form it prompts/saves the changes to main
form and sub-forms. As you can see, if they cancel the save, it undoes
all their changes prior to the save. Is that function still possible
while moving through sub-forms. So, if they make changes in both
sub-forms and then decide they don't want them, is their a script that
will allow me to undo all entries?

Thanks...any help would be appreciated.

Nov 13 '05 #2

P: n/a

Ed,

I agree with your philosophy in design. Unfortunately, most user
communities want as much ease of use as possible. Also, I might have
not been clear enough in what I was trying to do above.

The issue is with the way access works with subforms. I know once you
move between subforms, access by design, commits the changes you have
made. I simply want to be able to track all changes made in main form
and subform and once the user decides to move to another record, they
receive a prompt to save or cancel all changes. One prompt once. In my
current design, it prompts everytime they make a change between
subforms.

Thanks for you help.
Damon
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.