Why doesn't MsgBox work...?

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

Sorry to keep bothering you guys but I can't see why the
following doesn't work.

Private Sub FeesFrame_BeforeUpdate(Cancel As Integer)
Dim strMsg As String

If [DateInvoiced]<>"" And [FeesFrame] <6 Then
strMsg = MsgBox("blah, blah...., vbOKCancel,"Warning")
If strMsg = vbCancel Then
Cancel = True
End If
End If
End Sub

I would have expected that when the user clicks on Cancel,
the attempted change would be cancelled but it isn't - why
is this, do you know?

Many thanks as always,

Lee
 
Lee said:
Good point!!
However, this still doesn't work. Is it to do with the
fact that this event occurs when clicking on an item in an
Option Group (radio buttons)?

Setting Cancel = True only cancels the update event. It doesn't undo the entry. Is
that what you're looking for? If so you need to add...

FeesFrame.Undo
 
Back
Top