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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Switchboard

Status
Not open for further replies.

khch

Programmer
Jul 9, 2004
10
DK
PLEASE HELP BEACUSE I'M FRUSTRATED!
Hi,
I made a switchboard for my reservation database by first using the Switchboard Manager from MSaccess 2000 and then copying the buttons produced by the manager to new form called "subfrmSwitchboard" . I made also another form called "Main Switchboard" and added "subfrmSwitchboard" to it as a subform. I added also an unbounded subform called "subfrm" to the "Main Switchboard". The purpose of the "subfrm" is to get viewed my forms on it. I think this could be done by automatically changing the "Sourceobject" of the "subfrm" according to clicking on the buttons.

All this work is done to make the buttons list and the opened form to be displayed side by side on the same screen.

Note: I designed the Switchborad in this way because I don't know how to make it on other ways - Tips needed for other ways!

When I open the Main Switchboard in view mode, I get the buttons list to the left of the screen.

I need help of how to open/display an object (form, report etc.) on the the "subfrm". Said in another way how to change the "SourceObject" of "subfrm" and by this way get the buttons list and the form to be opened side by side on the same screen.

Note: The Switchboard Manager produced a function called " HandleButtonClick". I tried to force this function to assign the name of the form, that I want to open, to the "SourceObject" of the "subfrm", but I failed to do that.



Thanks!
 
Hi

In HandleButtonClick

you will find code similar to:

'
Case conCmdOpenFormAdd
DoCmd.OpenForm rst![Argument], , , , acAdd
'
Case conCmdOpenFormBrowse
DoCmd.OpenForm RsT![Argument]

Replace the DoCmd.OpenForm with something like

Me.SubFormControlName.Source = RsT![Argument]

not sure this is a good way to do things however, how are you going to handle Reports?, OnOpen event of the (sub) forms will not be triggered


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi,
Thanks for helping me. It works as I wanted. I added the following sentence to the HandleButtonClick function:

Case conCmdOpenFormBrowse
Forms!Main Switchboard!subfrm.SourceObject = rs![Argument]

and it works, but ....
When displaying the " Main switchboard" the focus is set to the "subfrmSwitchboard form, which has the buttons list. I think this is beacuse the [Event procedure], which has the code produced by "The Switchboard Manager", is added to the " On Open" of the "subfrmSwitchboard" form and not to the "Main Switchboard".

I need now to change the focus to the opened form. To do that, I added the following sentence to the HandleButtonClick:

Case conCmdOpenFormBrowse
Forms!Main Switchboard!subfrm.SourceObject = rs![Argument
Forms!Main Switchboard!subfrm.SetFocus

It works, but the view of "Main Switchboard" changed and doesn't appear as before.

Anybody can tell me why this happenies and how to fix it?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top