Before update, after update or change event? or does it matter?

C

Chris K

Couple questions

I use bound dropdown list for quite comprehensive display of future booking
dates including how many are already booked on those dates and same combo to
choose booking date for the client record - the problem is I need to guard
against them changing dates by accident when they're using the dropdown just
to look at future bookings

Private Sub Booked_AfterUpdate()
With Me.Booked
If Not IsNull(.OldValue) And .Value <> .OldValue Then _
If MsgBox("Change " & .OldValue & " to " & .Value & "?",
vbYesNo) = vbNo Then .Value = .OldValue
End With
End Sub

Works fine but my questions are

1/ Should I use before update, after update or change event? or does it
matter?

2/ Why wont it let me 'Undo' e.g.

If MsgBox("Change " & .OldValue & " to " & .Value & "?", vbYesNo) = vbNo
Then .Undo 'It doesn't 'undo' the changes no matter which event i use?
hence I used .Value = .OldValue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top