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

On Dirty, After_Update and Pressing ESC

Status
Not open for further replies.

Krystoff

MIS
Sep 18, 2002
129
0
0
US
Hello all,

I have a form that has reservation code on the On_Dirty event and I have code that takes of the reservation in the After_Update event of the form.

Basically it puts a value in a table when the form is dirty. When the user is done editing, the after_update code takes it out of that table.

I am having a problem that if the user starts editing something and then hits the esc key, the after_update event never fires therefor the value gets left in the table.

Is there someway I can fire the after_update or something similar if they stop editing the record in any way including pressing esc?

Any help is appreciated!

Chris
 
You might be able to do this with the KeyPress or KeyDown event. The following example is from the KeyPreview help:
Code:
Private Sub Form_Load()
    Me.KeyPreview = True
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    Select Case KeyCode
        Case vbKeyF2
            ' Process F2 key events.
        Case vbKeyF3
            ' Process F3 key events.
        Case vbKeyF4
            ' Process F4 key events.
        Case Else
    End Select
End Sub
I'm not sure how much this would slow your processing down, but it might work. From the example I would assume that the ESC key is vbKeyESC.

Hope that helps.



DreamerZ
simplesolutions@prodigy.net
[ignore][/ignore]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top