Popup?

  • Thread starter Thread starter Jason Gyetko
  • Start date Start date
J

Jason Gyetko

My main Switchboard form is open in full sceen size. I click a button on it
to open another form in popup style, from that popup form I click another
button to open a report, but the report opens up behind the popup form. I
know this is how it's supposed to work, my question is how do I get it so
that the report opens up over the popup form? If I set popup to no, then
the form opens up in full screen size and I don't want that. I need it to
open up just as it would if popup were set to yes, but not always stay on
top (this way I can see my report that is opened from that popup form). How
can I accomplish this? Thanks.
 
I would not open your switchboard in full screen. Why not just set the
option to not re-size, and simply set the option to "center" the
switchboard. If you remove the control box (the min/max buttons), then other
forms can be simply model (set that in the other tab). You then can control
which forms can be min/max. And, for any form you take away the min/max
button, then if the next form loaded (or report). is maxed, when closed, the
previous form DOES NOT take on the maxed setting since you removed the
min/max setting.

You can't do the reverse of the above, which would mean to max the
switchboard, and not have the form you open also be maxed. But, the reverse
works perfectly well if you REMOVE the min/max buttons from the form. So,
for example, your nice cute form calls a report and the report is maxed by
the user (or, as ALWAYS do put a docmd.Maximize in the reports on-open
event...since 99 out of 100 users prefer a nice large easy to view maximized
report). However, since the form that called the report does not have a
min/max button..the setting of the maxed report is NOT taken. In fact, that
small report actually protects the rest of the application of receiving the
full screen that the report had.

So, I would dump the idea of having a maxed switchboard. Once you dump that
idea...then controlling the rest of the application is easy, and you don't
need (nor should not) use popup forms.
 
The solution is not to maximize the switchboard. Set its width wide enough
to fill the screen, lengthen it, and eliminate scroll bars, min/max buttons,
border to none, and include a close app button on switchboard. Then you can
set popup to no on the other form that opens report....
When you maximize a window in Access, all other windows (except popups) are
also maximized when you switch to them.
HTH
Damon
 
Another trick is to use code in the report open to hide the popup while the
report is open.
The, in the report's close event you make it visible again.

Ragnar
 
What Ragnar suggested is best and works for all my apps. Here's a sample (add the lines which are bolded to your forms/switchboard):


'----FORM CODE/SECTION - CLOSE FORM BUTTON---------------

Private Sub cmdcloseform_Click()
On Error GoTo Err_cmdcloseform_Click

DoCmd.Close
Forms!switchboard.Visible = True

Exit_cmdcloseform_Click:
Exit Sub

Err_cmdcloseform_Click:
MsgBox Err.Description
Resume Exit_cmdcloseform_Click

End Sub

'---CODE IN FORM_SWITCHBOARD----------------

Private Function HandleButtonClick(intBtn As Integer)
' This function is called when a button is clicked.
' intBtn indicates which button was clicked.

'---SKIP DOWN TO THE SELECT CASE SECTION----

Select Case rs![Command]

' Go to another switchboard.
Case conCmdGotoSwitchboard

Me.Filter = "[ItemNumber] = 0 AND [SwitchboardID]=" & rs![Argument]

' Open a form in Add mode.
Case conCmdOpenFormAdd
Me.Visible = False
DoCmd.OpenForm rs![Argument], , , , acAdd

' Open a form.
Case conCmdOpenFormBrowse
Me.Visible = False
DoCmd.OpenForm rs![Argument]

'.... ON THROUGH (add Me.Visible=False in:)
' Open a report.
' Run a macro.
' Run code.
' Open a Data Access Page


End Select

Happy coding,
Tom
 
Back
Top