A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Switchboard



 
 
Thread Tools Display Modes
  #1  
Old September 15th, 2007, 10:17 PM posted to microsoft.public.access.gettingstarted
Mike from Moriches
external usenet poster
 
Posts: 11
Default Switchboard

Is there a way to go to a specific switchboard page and item (SwitchboardID
and ItemNumber) from code? If so, can you help me with some sample code?
Thanks,
Mike from Moriches

  #2  
Old September 17th, 2007, 02:50 PM posted to microsoft.public.access.gettingstarted
Wayne-I-M
external usenet poster
 
Posts: 3,674
Default Switchboard

Hi Mike

Can you give more details as not really sure what it is you are trying to do.


--
Wayne
Manchester, England.



"Mike from Moriches" wrote:

Is there a way to go to a specific switchboard page and item (SwitchboardID
and ItemNumber) from code? If so, can you help me with some sample code?
Thanks,
Mike from Moriches

  #3  
Old September 19th, 2007, 12:52 PM posted to microsoft.public.access.gettingstarted
Mike from Moriches
external usenet poster
 
Posts: 11
Default Switchboard


"Wayne-I-M" wrote in message
...
Hi Wayne
My switchboard has many pages. One item on the main page, "Lease
Management" goes to a menu of lease management items, lets assume on page
two of the switchboard. When I start up the database, I run a routine that
checks for leases expiring within 10 days, before the main switchboard
displays. If none exist, clicking command button brings up the switchboard,
no problem. if a lease is expiring, I would like a command button to take
me to item 3 on page two of the switchboard, which opens a form pertaining
to leases.
I hope I didn't confuse you. Thanks for your interest.
Mike

Hi Mike

Can you give more details as not really sure what it is you are trying to
do.


--
Wayne
Manchester, England.



"Mike from Moriches" wrote:

Is there a way to go to a specific switchboard page and item
(SwitchboardID
and ItemNumber) from code? If so, can you help me with some sample code?
Thanks,
Mike from Moriches


  #4  
Old September 19th, 2007, 07:10 PM posted to microsoft.public.access.gettingstarted
John Spencer
external usenet poster
 
Posts: 7,815
Default Switchboard

Instead of trying to open the switchboard and get the item, why not just
open the form directly. Or open the switchboard and then open the form.

If something = False Then
Docmd.OpenForm "Switchboard"
else
Docmd.OpenForm "Switchboard"
Docmd.OpenForm "Name of the form that you open with switchboard"
End if

Doing it with the switchboard is a bit more complex.

To open the switchboard to a specific page you can use the following, where
OpenArgs is the number of the switchboard page.
DoCmd.OpenForm FormName:="Switchboard", OpenArgs:="3"


You also need to modify the code in the switchboard's open event

Dim strSwitchBoardId As String

If IsNull(Me.OpenArgs) Then
strSwitchBoardId = "Default"
Else
strSwitchBoardId = Me.OpenArgs
End If

' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = '" & strSwitchBoardId &
"'"
Me.FilterOn = True

Then you need to change the HandleButtonClick from a Private to a Public
procedure so you can call it; Replace twh word Private with the word
Public. Then you can call the handle button click code with
Forms!Switchboard.HandleButtonClick(1)
- for button 1,


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

"Mike from Moriches" wrote in message
...

"Wayne-I-M" wrote in message
...
Hi Wayne
My switchboard has many pages. One item on the main page, "Lease
Management" goes to a menu of lease management items, lets assume on page
two of the switchboard. When I start up the database, I run a routine
that checks for leases expiring within 10 days, before the main
switchboard displays. If none exist, clicking command button brings up
the switchboard, no problem. if a lease is expiring, I would like a
command button to take me to item 3 on page two of the switchboard, which
opens a form pertaining to leases.
I hope I didn't confuse you. Thanks for your interest.
Mike

Hi Mike

Can you give more details as not really sure what it is you are trying to
do.


--
Wayne
Manchester, England.



"Mike from Moriches" wrote:

Is there a way to go to a specific switchboard page and item
(SwitchboardID
and ItemNumber) from code? If so, can you help me with some sample
code?
Thanks,
Mike from Moriches




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.