Action after you click the 'vbOKOnly' button

T

Tony Bender

I have a 'msgbox' that triggers dependant upon entries into a textbox
(TB7)within a userform. I'm having difficulty directing the action
immediatedly following when the user clicks the 'vbOKOnly' button on
the 'msgbox'. I'd like it to return to the textbox (TB7), and clear
it so the user must enter new data.

Should I be using a different vb button among those offered with
'msgbox'?


Appreciate any ideas...

thanks,
Tony B
 
J

JulieD

Hi Tony

the following works for me
Sub testbutton()
i = MsgBox("this is a message", vbOKOnly)
If i = vbOK Then
MsgBox "Hi"
End If
End Sub

- "Hi" message box displayed

but if you only have an OK button do you need to "test" for it

e.g.
msgbox "This is a message", vbOkOnly
TB7.setfocus
TB7.value = ""

Cheers
JulieD
 
Top