Switchboard Page2 ??

fibayne

Registered User.
Local time
Today, 15:23
Joined
Feb 6, 2005
Messages
236
:confused:Hi ..I have a swichboard that has gone on to 2 pages I am trying to add code to the OnClick event of an OptionButton on page2, problem is when I go to design view to add the code to the optionbutton as I did to a button on Page1 it will only show Page1 and I cant work out how to get to the buttons on page2 I dont believe what the code is is relevant but here it is
Code is
Private Sub Option1_Click()
Flag = 1
DoCmd.OpenForm "frmLogin"
End Sub

Would anyone know how to get to this Option Button ???

thanks again for any help ...cheers Fi
 
Last edited:
Each switchboard page is created on the first page of the switchboard manager. To access a subsequent page from the first page, you edit the first page and add a go to switchboard command.

Chris B
 
Hi Burrcm, Thank for your reply I think i have done that ok, I have a button on page 1 that takes me to page2. its when on Page 2 that I want to add the onclick to an Option button in effect Option9 (max number of option allowd on page 1 is set to 8)
Let me know if this doesnt make any sense and I will try to reword :) cheers Fi
 
Max 8 items on any page without major rework, just add another page and reference that from the previous page or wherever you like. You can also add a Back button to move up a level. If 8 to a page doesn't do it for you, don't use a switchboard at all, do it on a custom form with buttons. A bit of work, but much more flexible.

Chris B
 
Hi Chris...I cant work out to make referance to the option button on page 2 i imagine it has to be something like Switchboard, Page2, option1 ??? thans agin for your reply..cheers Fi
 
Not sure I quite understand, but from the beginning - open switchboard manager. The first page is automatic - Main Switchboard (Default). To create page 2 click New and type a name, say Page 2. Now edit page 1 - click on Main Switchboard, click edit. Click New. You will see three lines. On the first line type Page 2. The second line will already say Go To Switchboard. Click the drop arrow on the third line and pick Page 2. Click OK. Close out. Open your switchboard. Page 1 should contain a button called Page 2. Click this. You should move to a new page which is currently blank, as you haven't yet entered any items. With me now?

Chris B
 
Last edited:
Hi Chris..I have the 2 pages set up and the button on page 1 which takes me to page 2 what i am trying ot do is add an event to one of the option button on page2 when I open the swithcboard in design view it only shows page 1 ie option buttons 1 to 8 what I dont know is how to see page 2 and the 3 option buttons I have set up on it so that I can add an event to one of them ....is that making any more sense :) cheersFi
 
Yep. Open switchboard manager, click Page 2, Click edit. Now add items. These will appear on page 2.

Chris B
 
the standard switchboard works by reading items from switchboard items table, corresponding to the active page number.

the default is page 1

now if you need a new menu, say menu 2, create an item in the switchboard items table

menu 1, item 2, description "Second Menu", action 1, and an argument 2

action 1 means jump to menu
argument 2 means select menu 2

the switchboard code then tries to reread any menu items for page 2

basic commands are
action 0 - nothing (a menu header)
action 1 - goto menu
action 3 - open form, general mode
action 6 - exit application

other actions are open report. open form in add mode etc - i tend to only use the above

after you get used to it its easier to edit the switchboard items table directly

-----
for normal purposes, you should never have to program or edit any of the button or label click commands

i find 8 buttons a bit limiting, and i do add extra buttons, to give me 17 normally, 2 columns of 8, and a return to previous menu - if you follow it thorugh its just copying buttons, and editing some bits in the switchboard code to change the number of buttons from 8

------
note you have to have a menu item 1 on each page, or the display gets messed up.





i
 
All items are added via switchboard manager, not in the switchboard design view. Tools - Database Utilities - Switchboard Manager.

CB
 
Hi...thanks to both of you for your help but i just cant get my head round it... on page 2 I have 3 option buttons I would like to add the code which opens a login form to check passwords before the underlying form attached to each option opens, I did this with no problem on an option button on page one by simply openign the switchboard in design view and adding the event to the onclick event of that option...Gemma you say this is not a good idea can I add this code elsewhere or in a diff way I can see on the table the arguments field, should it go there ..somehow ?? thank again Fi
 
Where dont you just make a switch board with Tabs and relevent titles on each tab?
 
yes but the option button 1 will apply to any option 1 on any menu.
ie menu 1, uses buttons 1 to 8 to select options 1 to 8
ie menu 2, uses buttons 1 to 8 to select options 1 to 8

so you cant (easily) have button 2 doing some things on menu 1, and others on menu 2

if you want to check stuff like this you should get the user to login initially then either

a) change the switchboard manager programme to check whether the active user should "see" these menu items BEFORE displaying them, or

b) check whether he can run the form etc, before opening it, in the switchboard manager code or

c) in the form's open event check whether the user can run the form, and if not, close

all slightly different - depends what you want
 
Since there is only one actual form, anything added to on click will always have the same effect regardless of which menu page you are on. I think building your own menu forms rather than using switchboard will solve it for you.

Chris B
 
Hi Gemma thanks for the clarification, understand what you are saying, need to find a differant solution as you say, will have a go at your suggestions and post back with my "success"...cheers Fi
 
thanks Chris I understand where i was going wrong now will try differant solution :) cheers Fi
 

Users who are viewing this thread

Back
Top Bottom