UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Modal Popup Not Staying On Top, Access 2016    
 
   
wheeledgoat
post Jul 11 2019, 12:12 PM
Post#1



Posts: 54
Joined: 18-December 18



I seriously hope someone out there has some enlightening words for me, because this is making me downright ANGRY. mad.gif mad.gif mad.gif

The load event of a popup (non-modal) frmMenu runs a module that will DoCmd.OpenForm "frmUserSelect" (it's a module because it needs to be called from another form too)

The frmUserSelect, despite being Popup and Modal, ends up under frmMenu.

I put msgbox triggers all over the code (at the start/end of each open, load, etc..) and witnessed frmMenu appearing for the first time after the frmUserSelect had appeared, after the load event had finished. WHY?!?!?

I thought the form opening events went in this order: OPEN, LOAD, RESIZE, ACTIVATE, CURRENT. But even when I trigger the module (that opens frmUserSelect) in the CURRENT event, frmMenu STILL appears after frmUserSelect and on top of it!!!

I tried setting frmMenu.Visible = False but that had no effect, and I didn't delve too deeply into that because it's too much of a bandaid - would rather understand and code this the right way. Besides, it'll be disorienting to new users to have the minimalist frmUserSelect screen without the context of the frmMenu behind it.

AAARRRGGGGHHH. Please help???

Edit: Even when I click a button that runs Forms!frmUserSelect.SetFocus, the frmMenu stays on top!! I feel like that's a good clue as to what's going on, but I don't know where to go from here.

This post has been edited by wheeledgoat: Jul 11 2019, 12:20 PM

--------------------
"If you don't make mistakes, you're not working on hard enough problems." -Frank Wilczek

"Success is getting what you want. Happiness is wanting what you get." -B.R. Hayden

Virtue is sufficient for happiness, therefore a sage is immune to misfortune.
Go to the top of the page
 
theDBguy
post Jul 11 2019, 12:19 PM
Post#2


Access Wiki and Forums Moderator
Posts: 76,028
Joined: 19-June 07
From: SunnySandyEggo


Hi. If your entire code to open frmUserSelect is simply that, they try changing it to this:
CODE
DoCmd.OpenForm "frmUserSelect", , , , acDialog

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
wheeledgoat
post Jul 11 2019, 12:29 PM
Post#3



Posts: 54
Joined: 18-December 18



Brilliant! That holds the code up to where I only see the frmUserSelect (the load event doesn't finish until the called module completes) which isn't exactly the functionality I was looking for, but I'll expand the frmUserSelect to provide the context required. May actually work out better.

Thanks a ton!!

And for anyone following this later, the code actually needs one more comma. Use this one:
CODE
DoCmd.OpenForm "frmUserSelect", , , , , acDialog


You're the best DBGuy!! Wish I could buy you a pint or something. Thanks so much.

--------------------
"If you don't make mistakes, you're not working on hard enough problems." -Frank Wilczek

"Success is getting what you want. Happiness is wanting what you get." -B.R. Hayden

Virtue is sufficient for happiness, therefore a sage is immune to misfortune.
Go to the top of the page
 
theDBguy
post Jul 11 2019, 12:36 PM
Post#4


Access Wiki and Forums Moderator
Posts: 76,028
Joined: 19-June 07
From: SunnySandyEggo


Hi. Sorry for the typo. Glad to hear you got it sorted though. Cheers and good luck with your project.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
dale.fye
post Jul 11 2019, 04:22 PM
Post#5



Posts: 134
Joined: 28-March 18
From: Virginia


You might also try moving that openform command to the main forms timer event (if there is nothing else there).

Set the timerinterval property of frmMain to 0 to prevent the timer from firing.
Then, in the Form_Open event (still frmMain), set the TimerInterval to 1000 (1 second).
Finally, in the Form_Timer event, use something like:
CODE
Private Sub Form_Timer

    me.timerinterval = 0
    DoCmd.OpenForm "frmUserSelect", , , , , acDialog

End Sub
You might also consider putting that code that sets the timerinterval = 1000 as the last item in the Form_Load even, but it sounds like this is just a menu form with buttons and no RecordSource, so the Open event should be just fine.

--------------------
Dale Fye
Microsoft Access MVP 2013-2016
Developing Solutions, LLC
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th August 2019 - 09:57 PM