View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
No spam please No spam please is offline
external usenet poster
 
Posts: 2
Default Msgbox delayed using AFTERUPDATE

Please help

I have used various afterupdate commands in VB to enable fields and
change the background colour of fields when specific things happen to
fields.

My problem is that I have added a "msgbox..." with a yes-no option in
the afterupdate code BUT the msgbox doesn't appear until the I click the
mouse on another field or on the form itself.

What am I missing to make the popup display straight away.

I can't use _change as the msgbox pops up when the field is populated
when the details are first returned. And, beforeupdate doesn't make any
difference.

cheers
Aaron

Private Sub cbCurrent_AfterUpdate(ByVal Cancel As MSForms.ReturnBoolean)
'================================================= ======================
==
'Transfers information from the clients record to the history screens
when
'the client becomes current again
'================================================= ======================
==
If cbCurrent = "Yes" Then

'Present a confirmation box
Dim Msg2, Style2, Title2, Help2, Ctxt2, Response2, vConfirm2
Msg2 = "Do you want to create a history record for the youth? (A
history record is not required if this is the first time the youth will
be current)" ' Define message.
Style2 = vbYesNo + vbCritical + vbDefaultButton2
' Define buttons.
Title2 = "Please confirm"
' Define title.
Help2 = "DEMO.HLP"
' Define Help file.
Ctxt2 = 1000

'Record response
Response2 = MsgBox(Msg2, Style2, Title2, Help2, Ctxt2)

'Check if Yes or No
If Response2 = vbYes Then ' User chose
Yes

If tbHistRefDate1 = "" Then
tbHistRefDate1 = tbRefDate
tbHistRefSource1 = cbRefSource




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!