473,395 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 2219
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 preview mode. I want to be able to close the report...
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 be saved to a default folder (or one that they...
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 but don't know how to save the changes i made. ...
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 code Private Sub CreateXLS(ByVal xdatagrid As...
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 codes work out fine separately. Code for Audit...
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 view/edit them in the future? Actually I've just started...
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 myX = 640
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 works fine normally, however on occassions the...
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 client device hard drives. They can do that right...
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 Not Null) and ADezii prompt me to use this code...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.