Hello, I have a button on my form (Maindb) thats named ReportsSwitchboard and
when clicked it brings up a form that is a paramater form. Is there some way
to hide the MaindB form when the ReportsSwitchboard is open and when the
ReportsSwitchboard is closed the MaindB form isnt hidden anymore. Please
explaing because im new to Access... Thanks!
Regan - 14 Jun 2007 23:18 GMT
>Hello, I have a button on my form (Maindb) thats named ReportsSwitchboard and
>when clicked it brings up a form that is a paramater form. Is there some way
>to hide the MaindB form when the ReportsSwitchboard is open and when the
>ReportsSwitchboard is closed the MaindB form isnt hidden anymore. Please
>explaing because im new to Access... Thanks!
in on click event put
Me.visible = false
On ReportsSwitchboard Close event put
Select Case SysCmd(acSysCmdGetObjectState, acForm, "Maindb")
Case acObjStateOpen
'Form is open but is not visible
Forms!maindb.SetFocus
Forms!Maindb.Visible = True
Case 0
'Form is closed, Do nothing
Exit Sub
Case Else
'Form has been put into some mode not anticipated. Handle here
MsgBox "Not anticipated", , "Not anticipated"
End Select
Hope this helps

Signature
Regan,
Paeroa
World famous in New Zealand
Steve - 14 Jun 2007 23:28 GMT
Add the folowing code to the code in the Click event of your button:
Me.Visible = False
Put the following code in the Close event of ReportsSwitchboard:
Forms!MainDb.Visible = True
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com
> Hello, I have a button on my form (Maindb) thats named ReportsSwitchboard
> and
[quoted text clipped - 3 lines]
> ReportsSwitchboard is closed the MaindB form isnt hidden anymore. Please
> explaing because im new to Access... Thanks!