473,406 Members | 2,867 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,406 software developers and data experts.

My forms commit anything to the database

I've created some forms for my database and I'm having a problem controlling what data is saved to it. It seem that anything that is typed/selected on the form is saved automatically by the database, even if 'enter' is not pressed. Is there any way to turn this off?

Edit:
My mistake, I posted this in the wrong section. Can the admin move this topic to its correct location.
Oct 9 '07 #1
5 1529
nico5038
3,080 Expert 2GB
In general Access will save all data entered on a form when you navigate to a next/other record in the form.
When you want to have control, you'll need to use two buttons: [Save] and [Cancel].
When the user presses [Cancel] you can undo the changes, taking care they're not save with this code:
Expand|Select|Wrap|Line Numbers
  1. ' Test something has changed. (When there are no changes an Undo will give an error!)
  2. IF Me.Dirty then
  3.    Me.Undo
  4. endif
  5. docmd.close
  6.  
The same Undo can also be triggered by using the {Esc} key.

Clear ?

Nic;o)
Oct 9 '07 #2
Where and how do I place the code? I tried using the wizard to create both buttons but the same problem occurred.
Oct 9 '07 #3
nico5038
3,080 Expert 2GB
Open the properties for the Cancel button and select the "programming procedure" for the OnClick event (just a double click on the eventtext will give the proper selection), then click on the [...] button at the end and enter the code between the sub and end sub (The cursor is in the right place when the code gets visible)

Nic;o)
Oct 10 '07 #4
Forgot to say thanks for this.
Oct 12 '07 #5
nico5038
3,080 Expert 2GB
No thanks needed, Im always glad when I can teach someone new ways to use Access :-)

Nic;o)
Oct 12 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: DP | last post by:
Is there any command exists as "commit transaction" ? begin transaction < DML1 stmts > begin transaction < DML2 stmts > rollback transaction commit transaction which set of DML will be...
11
by: Markus Breuer | last post by:
I have a question about oracle commit and transactions. Following scenario: Process A performs a single sql-INSERT into a table and commits the transaction. Then he informs process B (ipc) to...
2
by: janet | last post by:
HI, I had a question on auto-commit in DB2 EEE V8 on AIX V5. Here is my example.. there are two script A.sh , B.SQL A.sh is following:
7
by: Ugrasena via DBMonster.com | last post by:
Hi team i am using DB2 7.2 on Windows2000. We have lot many SQL Procedure Calls, is there any way i can Turn off the Auto Commit on that Database, the Problem i have is many of our Application...
3
by: Peter Kirk | last post by:
Hi there when working with database connections in C# is there a concept of "auto commit"? For instance, if I obtain a database connection in java I can set the auto-commit state to true or...
3
by: Saket Mundra | last post by:
I have multiple web forms in my application. The user after logging on is directed to form1 where he enters information desired. Once finished he is directed to form2 and the same procedure goes on...
3
by: Ralf Assmann | last post by:
Hi there, we have the following problem using a DB2 version 7 on z/OS, referring also <a...
3
by: Anonymous | last post by:
I resolved this issue. If you are using an Oracle XA DataSource, Oracle's JDBC driver will automatically issue a COMMIT when it sees a "DROP TABLE foobar" statement. Oracle's JDBC driver...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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
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...
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
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...

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.