Action after you click the 'vbOKOnly' button

  • Thread starter Thread starter Tony Bender
  • Start date Start date
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
 
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
 

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

Back
Top