Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cancel update

Status
Not open for further replies.

raj00

IS-IT--Management
May 7, 2001
9
0
0
US
I am working on a visual basic project where i have a form where i am showing the data from the table. On one of the field i am allowing user to change the data. How can i disregard chages if the user exit the form.

Thanks
Raj
 
Do not use bound controls and only update if the user wants to. You can check for the form exit in the Form_QueryUnload Event.
 
I believe that you can, if you are using bound controls, use the CancelUpdate() method of the recordset object that you have bound to. You have to check the status of the recordset first. There may be other statuses that you need to check for but the following code should work.

If (rs.State And adRecModified) Or (rs.State And adRecNew) Then

rs.CancelUpdate

End If


hope that helps.
scott
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top