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

close button in an Access form

hi! plz help me out with this.
i have created a small program of data entry and have this problem
well whenever i close the form with the close button on the form it saves the record.
i dont want the record to be saved withour pressing the save button.
plz give a solution for this
Apr 25 '07 #1
3 3261
Lysander
344 Expert 100+
hi! plz help me out with this.
i have created a small program of data entry and have this problem
well whenever i close the form with the close button on the form it saves the record.
i dont want the record to be saved withour pressing the save button.
plz give a solution for this
One solution would be to disable the close button on the form and add your own close button. Then check in the code if the record has been changed (me.dirty=true I think) and if so, either refuse to let the form close, or undo the changes before closing.

A second option, and I think a better one if the system is multiuser, is to use unbound forms so that the only way to save the data is via your Save button.
Apr 25 '07 #2
One solution would be to disable the close button on the form and add your own close button. Then check in the code if the record has been changed (me.dirty=true I think) and if so, either refuse to let the form close, or undo the changes before closing.

A second option, and I think a better one if the system is multiuser, is to use unbound forms so that the only way to save the data is via your Save button.
if i use the save button to save the record in the unbound form
how will i do it with a code
will the insert into cose work in MS Access
Apr 25 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. Dim strSQL As String
  2.  
  3.    strSQL = "INSERT INTO TableName (Field1, Field2) VALUES (" & _
  4.       Me.textbox1 & ", '" & Me.textbox2 & "')"
  5.    DoCmd.RunSQL strSQL
  6.  
In this example Field1 is a number datatype and Field2 is a text datatype.
Apr 25 '07 #4

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

Similar topics

5
by: Nick250 | last post by:
I have a simple app that I created for our Real Estate office using Access 2000 and it is working fine except for on thing. I need to keep the close button hidden from the users. No problem...
5
by: Reggie | last post by:
Hi and TIA! I have a form and have set the Close Button to false so that users must exit using my close button. However when I open a Report from this form I want the close button to be available...
6
by: scott | last post by:
I guess this is a simple one but I can't seem to get it to work. I want to refresh an open form "onClose" of another. I have a Close button on a form which has User Details on it. If I update...
4
by: zack | last post by:
Any help with this would be greatly appreciated, as cannot work out how to resolve. I have a report called "3_Strikes". In its 'On open' event is command to also open a criteria form popup form...
1
by: KMEscherich | last post by:
Using Access '97 Hi there, am wondering if there is a way to have a CLOSE button on the form and have it NOT CLOSE the form unless all the REQUIRED controls have an entry. I have 3 items I...
2
by: Eric | last post by:
Hi, I have a form that requires a save button to be clicked before closing the form. I would like a msgbox to pop up when the button is not clicked before closing. Can someone show me how i...
2
by: Bruce | last post by:
Hello, I have a form in an Access 2003 application which opens maximized. Its CloseButton property is set to false. On this form I have a command button that opens a report in preview mode. ...
3
by: Kelii | last post by:
I've been beating my head against this problem for the last several days, and I haven't found a decent solution yet. So I'm turning to the group for some moral support or better yet some answers. ...
0
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
5
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.