473,671 Members | 2,215 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Save Prompt issue between sub-forms

am using the following script in the BeforeUpdate area of a main form.
Private Sub Form_BeforeUpda te(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.Ech o (False)
Me!sfrmAddress. SetFocus
DoCmd.RunComman d (acCmdUndo)
Application.Ech o (True)
'Me!RolodexNew. SetFocus
'DoCmd.RunComma nd (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 2244
I'm continually confused by application designs that ignore and/or work
around the default Access behavior to opportunistical ly 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******@dream works.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .
am using the following script in the BeforeUpdate area of a main form.
Private Sub Form_BeforeUpda te(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.Ech o (False)
Me!sfrmAddress. SetFocus
DoCmd.RunComman d (acCmdUndo)
Application.Ech o (True)
'Me!RolodexNew. SetFocus
'DoCmd.RunComma nd (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
3161
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 without saving the changes, and without being prompted to save the changes. It is easy enough to get rid of the save prompt by using docmd.setwarnings=false; however, the default behavior of Access is to save the design changes. I can't seem to...
8
2686
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 choose) on the users / client file system. I have toyed with a Self-Extracting zip file but the contents of my zip file changes each time it is downloaded so that invalidates the exe file. Also the text file is so small it is a waste to zip it.
2
1312
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. thanks in advance
0
1280
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 DataGrid) Response.Clear() Response.AddHeader("content-disposition", "filename=New_Report.xls") Response.Charset = "" Response.Cache.SetCacheability(HttpCacheability.NoCache)
2
3191
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 Trail Option Compare Database Const cDQ As String = """" Sub AuditTrail(frm As Form, recordid As Control) 'Track changes to data. 'recordid identifies the pk field's corresponding
8
19495
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 with python and would be grateful for a response. Thanx!
2
5760
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
3503
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 remote piece of kit may be busy and will not talk to me, leaving me to logoff cleanly and try again later. Using net::telnet and the following code I am trying to wait for the prompt of ? to be returned if it is not returned after 60 seconds I wisk...
3
4348
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 now the way I have this set up, but it's confusing and slow. When they browse for a place to save the reports, they see all of the drives on the terminal server as well as their own client drives. So they're likely to want to choose "My...
26
6913
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 and it gives me the msgboxes which I need to be viewed to the user but after that It gives me an error because the code which I used for save cmdbutton is private sub save_click() docmd.save docmd.requery (the error because of this I think)...
0
8472
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8390
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8909
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8819
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8596
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4221
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.