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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i stop acces from updating the database on a new query

Status
Not open for further replies.

Hitower

Programmer
Mar 28, 2002
11
NL
Ok i am guessing that this will be a simple one for u all but i dont know so i am just gonna ask neway :p.
When u do a query in a database and u change something in the form and u leave the form it automaticly saves the changes u have made. How can i interrupt that by means of like a msgbox promping to cancel it ? I want VB to ask if i want to keep the changes or not but i need the code to stop acces from updating the db when i press cancel :)
btw yes i am a newbie in this so dont laugh ok :)

Regards Hitower



 
Try this HiTower:

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty Then
If MsgBox("Update Records?", vbQuestion + vbYesNo, "Update Confirmation") = vbNo Then Cancel = True
End If
End Sub

I think this should work for you.
Shane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top