Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Onload Form Behind Main Form 1

Status
Not open for further replies.

Mugs321

Programmer
Jan 31, 2007
49
CA
Hey all,
I've seen this kind of question posted before but I've not come across any solutions that work.

Here's the deal:
I have a form (Main) that should open another form in its Onload event. This works. The problem, however, is that the form which is opened displays behind the 'Main' form.

I need the second form to display on top of 'Main'. However, as this second form opens other forms while staying open, it can't be a 'pop-up'. Currently it's set as Modal.

I've tried setting the 'Main' for as Visible = False (which did nothing) and I've also tried setting focus to the second form as well as setting focus to a control on the second form. Nothing's working.

Any suggestions?
 
A thought.....

Terms:
Main Form
Second Form (called from Main OnLoad)
Other Forms (called from Second form)

Set the Second Form to be PopUp. This will force it on top. Then each Other Form can use its OnLoad event to turn the PopUp off of the Second Form and its Unload event to turn the PopUp of the Second Form back on.

----

Another thought is that you can have more than one form set as Popup. For all the Popup-enabled forms, the last one open should be on top. So if you set the Second Form and ALL Other Forms to Popup, you should get the same basic effect.

I would also recommend all these Popup form be labeled as Modal also to keep focus...since you seem to be trying to control user movement.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
mstrmage,
Once again you've enlightened me.

I set the rest of my forms to Popups and this seems to have resolved my issue.

Some other things I tried:
- Opening the 'Other' forms using the 'acDialog' parameter in the DoCmd.OpenForm also worked.

- When I tried to set the PopUp property of the 'Second' form (named 'newAdditions') using:

Forms![newAdditions].PopUp = False

I got the following error:

Run-time error '2448': You can't assign a value to this object
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top