473,396 Members | 1,970 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,396 software developers and data experts.

Disable how Access automatically saves forms into table...

Hello,

I am currently using Access 2007 on an XP laptop. I have a table and a form used to add records to the table.

I have noticed that if I close the form without filling out all of the information in the form, the form data is still written to the table as a record. Since the person using this form may have to unexpectedly close the form, how can I disable this functionality? I do not want incomplete records being saved to the table.

Thanks!
Jul 10 '07 #1
3 7735
missinglinq
3,532 Expert 2GB
I always go into Design View for the form, under Properties - Format set Close Button to No, then put my own close button on the form. Then use spmething like this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CloseFormButton_Click()
  2. If Me.Dirty Then
  3.   resp = MsgBox("Do You Wish to Save The Last Record Added?", vbYesNo,  "Save New/Edited Record?")
  4.      If resp = vbNo Then
  5.        Me.Undo
  6.      Else
  7.        Me.Dirty = False
  8.      End If
  9. End If
  10. DoCmd.Close
  11. End Sub
This way Accesss will check the record to see if it's Dirty, then give the user the option to either save or discard the new record.. You should also be aware that at times, if a required field is not filled in, Accesss will Exit and not Save the record!

Linq ;0)>
Jul 10 '07 #2
It worked great. Thanks!
Jul 11 '07 #3
missinglinq
3,532 Expert 2GB
Glad we could help!

Linq ;0)>
Jul 12 '07 #4

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

Similar topics

3
by: Christopher Koh | last post by:
how do you stop Access from saving any changed data in your tables and queries? like i just add or change data on the table/query tables,then click on X (exit)because i have no intention of saving...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
15
by: Mark C | last post by:
All, I have exhaustingly been looking through the newsgroups in search of a way to systemically output an Access 97 report to a pdf file using the full version of Adobe Acrobat. I want the user...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
25
by: DFS | last post by:
I have a job to automatically import Excel data and post to database tables, via a point-click interface. Choose-file-and-it-does-the-rest kind of thing. Cient stores data in columns in his...
0
by: zeeshansohail | last post by:
I am developing a Database in ORACLE. I have Master/Detail relationship between two tables named as BILL (Master Table) and DETAIL_DETAIL (Detail Table). Master Table BILL contains product...
2
by: bandkindy | last post by:
To preface, I am pretty green on the whole sql thing, but am learning quickly so please bear with me. I have an excel file that is copied to 5 users directories so they have their own working...
1
by: bandkindy | last post by:
To preface, I am pretty green on the whole sql thing, but am learning quickly so please bear with me. I have an excel file that is copied to 5 users directories so they have their own working...
9
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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.