Why doesn't MsgBox work...?

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
 
R

Rick Brandt

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
 

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

Similar Threads


Top