Moving Swithcboard To Back

dataheadache

Registered User.
Local time
Today, 16:13
Joined
Feb 18, 2004
Messages
28
I have created a switchboard in Access, however, when I click on an item the "item" opens up behind the switchboard - meaning that I have to move the Switchboard out of the way to see the "item" - how do you get the Switchboard to either move behind the "item" until the "item" has been closed or minimise the Switchboard until the "item" has been closed?
 
I usually hide my switchboard forms using
Code:
Me.Visible=False
and make it visible again when I need it.
 
dcx693 said:
I usually hide my switchboard forms using
Code:
Me.Visible=False
and make it visible again when I need it.

So, using the above code, How do I make the switchboard automatically reappear after I close the hypothetical "item" (preferably without using the Window - Unhide Menu item)?
 
dataheadache said:
Thanks for the help everyone - but this website had exactly what I needed.

Which is what was suggested here.. :confused:
 
Mile-O-Phile said:
Which is what was suggested here.. :confused:
Not Quite - Anyway, I have a second problem now - I've used this code
Code:
'In the main form:
Private Sub cmdOpen3_Click()
 Me.Visible = False
 DoCmd.OpenForm "Form3", OpenArgs:=Me.Name
End Sub

'In the second form:
Private Sub Form_Unload(Cancel As Integer)
 Forms(Me.OpenArgs).Visible = True
End Sub
to close the switchboard and open the second form - but if the second form then opens a report, how do I modify this code to show the Switchboard again ONLY after the report is closed OR the cancel button is pressed on the second form? At the moment the switchboard reappears after filling in the second form and covers the resulting report!
 
To test if a report is currently open, use this code:
Code:
Function IsReportLoaded(strReportName As String) As Boolean

IsReportLoaded = _
    SysCmd(acSysCmdGetObjectState, acReport, strReportName) = acObjStateOpen
    
End Function
Or you might want to set a public variable equal to the name of a report as you open it to keep track.
 
dcx693 said:
To test if a report is currently open, use this code:
Code:
Function IsReportLoaded(strReportName As String) As Boolean

IsReportLoaded = _
    SysCmd(acSysCmdGetObjectState, acReport, strReportName) = acObjStateOpen
    
End Function
Or you might want to set a public variable equal to the name of a report as you open it to keep track.


... but how do I get the second form to not reload the Switchboard until after the resulting report is closed (i.e get the report to re-open the switchboard when it is closed)? I don't particularly need the above code to check whether the report is still open, just one to re-open the Switchboard when the report is closed.
 
Function FrmHide()
Dim frm As Form
For Each frm In Forms
frm.Visible = False
frm.Modal = False
Next
End Function


Function RptClose1()
On Error GoTo RptClose1_Err

Dim rpt As Report

For Each rpt In Reports


DoCmd.Close acReport, rpt.Name

Next
DoCmd.ShowToolbar "Menu Bar", acToolbarYes
DoCmd.ShowToolbar "Custom 1", acToolbarNo
DoCmd.RunCommand acCmdAppRestore
Call FrmVis
RptClose1_Exit:

Exit Function

RptClose1_Err:
MsgBox Error$
Resume RptClose1_Exit

End Function

Sub FrmVis()
Dim frm As Form
For Each frm In Forms
frm.Visible = True
Next
End Sub
 
Thanks for that code, Rich - but is there an easier option, I mean, is there a Report_Close or Report_unload option where you could put:

DoCmd.Close
DoCmd.OpenForm "Switchboard"
 
Rich, you'd better go for a lie down. Conserve your energy, that must have taken it out of you to type all that. :rolleyes:
 
Mile-O-Phile said:
Rich, you'd better go for a lie down. Conserve your energy, that must have taken it out of you to type all that. :rolleyes:


I deleted 9/10th's of it :mad:
 
Pehaps I didn't make it clear enough. Let's try again...

Is there anyway to automatically open a form when a report is closed?
 
Is there some reason why you close it and not just toggle its visible property?
Either way it's DoCmd.OpenForm "YouFormName" in the CloseEvent of the Report
 

Users who are viewing this thread

Back
Top Bottom