Message Box Help

S

Sam

I'm learning the VBA and have created a USERFORM that has several text boxes.
One of the boxes is and address field with multi-line option. I would like
a small message box to "pop" up when the user enters that box telling them
how to make the 2nd line (CTRL+Enter) -- the dissapear when leaving that box.

Is this possible?
 
C

carlo

I'm learning the VBA and have created a USERFORM that has several text boxes.
 One of the boxes is and address field with multi-line option.  I would like
a small message box to "pop" up when the user enters that box telling them
how to make the 2nd line (CTRL+Enter) -- the dissapear when leaving that box.

Is this possible?  

Hi Sam

First of all, you might consider to change the properties of your
textfield to:
EnterKeyBehavior = True
and
MultiLine = True

That way, the User doesn't need to hit Ctrl + Enter to change the
line, Enter will be sufficent.

If you still want to tell the user what to do, you could add a Label
to the form.
In the onEnter event of your field you set the Label to visible, in
the onExit event you set it to invisible, like that:

Private Sub TextBox1_Enter()

Me.Label1.Visible = True

End Sub

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)

Me.Label1.Visible = False

End Sub

Private Sub UserForm_Initialize()

Me.Label1.Visible = False

End Sub

hope that helps

Carlo
 
J

john

Sam,
You can use the ControlTipText Property which will show your message when
the mouse hovers over the control. eg:

Textbox1.ControlTipText = "to make the 2nd line use (CTRL+Enter)"

see Help for more info.
 

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

Top