How to force userform to display everything?

  • Thread starter Thread starter John Mitchell
  • Start date Start date
J

John Mitchell

If I do the following...

with userform1
.textbox1.value = "Some text to display"
.show (modal)
end with

The form displays but the text box doesn't show. It's as if the form had
no controls. However, if I add a msgbox command...

with userform1
.textbox1.value = "Some text to display"
.show (modal)
msgbox "Press OK to continue.."
end with

The modal form displays correctly.

How can I get the modal form to do what I want without having to wait
for input, which defeats the whole purpose of using a modal form to pass
information?

Regards, John M
 
John,

I can't reproduce, so just a guess - maybe Repaint would force it:

With UserForm1
.TextBox1.Value = "Some text to display"
.Show (modal)
.Repaint
End With

hth,

Doug Glancy
 
Note that you are showing your userform as a Modeless userform (not modal as
you claim). Modal would mean that it retains the focus until dropped.

(modal)
is not a constant and resolves to 0 as you use it. Zero is the value of the
defined constant vbModeless

? vbModeless
0
The constant for modal is

? vbModal
1

It usually helps to use correct terminology.
 

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