472,328 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

Save Prompt issue between sub-forms

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
2 2166
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: jer | last post by:
I have created a subroutine that opens a report in design view, modifies the report (adds text boxes and grouping levels, etc.) then opens in...
8
by: DanB | last post by:
This is probably soooo simple but I can't seem to get it. I have a text file that I want users to download via a web page. I want the file to...
2
by: jaYPee | last post by:
anyone know how to save record that is encoded from a textbox back to sql server 2000? i know how to display a record from sql server to textbox...
0
by: Matt Schwartz | last post by:
I have a ASP.NET web application written using VB.NET. I have a data grid, that is sent to the browser as an excel document using the following...
2
by: rockdc1981 | last post by:
I dont it is possible to put this codes together.. I want to prompt the user to save the record and at the same time have a log of audit trail. the...
8
by: why? | last post by:
Im working with Python 2.2 on my red hat linux system. Is there any way to write python codes in separate files and save them so that i can...
2
jamesd0142
by: jamesd0142 | last post by:
Private Sub SaveResized() Dim bm As New Bitmap(PictureBox1.Image) Dim myX As Integer Dim myY As Integer ...
0
by: SteveBark | last post by:
Any pointers on this truly appreciated. I am using net::telnet to connect to a modem pool and then connect with a remote piece of kit. Everything...
3
by: evenlater | last post by:
I have an Access application on a terminal server. Sometimes my users need to export reports to pdf, rtf or xls files and save them to their own...
26
mseo
by: mseo | last post by:
hi, I am developing a form for adding employees where you can find three fields in the table employees (firstname, middlename, lastname, hiredate (Is...
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.