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!

BeofreUpdate

Status
Not open for further replies.

gavinjb

Programmer
Apr 24, 2003
106
GB
Hi,

I am trying to write an function to prompt the user if they want to update it if they make a chnage to the field, and if they cancel no, to go back to the previous value, does anyone know how to do this. The Code I have written so far us as follows, but it still excepts the new value, does anyone have any ideas how I get get access ti revert to the previous value.

Code:
    If Not IsNull(Me.OpCentre) Then
        If MsgBox("Are you Sure?", vbYesNo, "Change Op-Centre") = vbNo Then
            Cancel = True
            Exit Sub
        End If
    End If
 
Are you talking forms before update or controls before update?

For forms before update, you might have a look at the controls OldValue propery, for the controls before update, do you simply want to:

[tt]Me!OpCentre.Undo ' not the one by Tom Clancy, is it;-)[/tt]

Roy-Vidar
 
that worked brilliantly thanks (for the Control), no it is for Vehicle Operating Centres.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top