How can I programatically bring a form to the top?

M

Max Moor

Hi All,

If I have a number of forms open on top of each other, how can I use
VBA to make any specific one on top of the rest?

Regards,
Max
 
M

Mark A. Sam

Max,

That isn't the way to do it. Over lay one or more forms on top of each
other and set their visible properties, like this:

SubForm1.Visible = True
SubForm1.Visible=False

Where SubForm1 and SubForm2 re[resent your Subforms.

Try this with a button using the OnClick event.

SubForm1.Visible = Not SubForm1.Visible
SubForm2.Visible=Not SubForm2.Visible

In designview of the main form, set the Visible property of SubForm1 to
Visible = True and SubForm2.Visible = false.

The Button will toggle between the subforms.

God Bless,

Mark A. Sam
 
Top