If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > DoCmd.Close acForm, formName, acSaveNo always save a record?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-12-06, 09:30
HungVo HungVo is offline
Registered User
 
Join Date: Feb 2005
Posts: 9
DoCmd.Close acForm, formName, acSaveNo always save a record?

I have an Access form that is mapping to a SQL Sever table. The form allows users to enter data, and then click a button ADD or CANCEL. The form has a text box ID that is mapping with the primary key ID of the table student. The button ADD works OK, but the problem is the button CANCEL. If a user enters an ID, and the user clicks the CANCEL button, the VBA 'DoCmd.Close acForm, formName, acSaveNo' always save that record.

Please give me some suggestions?

Thank you.
Reply With Quote
  #2 (permalink)  
Old 09-12-06, 10:59
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Hi

The acSaveNo relates to the form not the data. You want to do someting like Me.Undo (or something - been a while since I worked with bound forms) to cancel the commital of data to the database.

HTH
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #3 (permalink)  
Old 09-12-06, 11:36
HungVo HungVo is offline
Registered User
 
Join Date: Feb 2005
Posts: 9
You are right friend. I should use UNDO before closing the form.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On