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
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