Switchboard Menu Title Revisited

A

Andy

Hi, there was a thread started by "Giberish" back on June 16, 2006 titled
"Switchboard Menu Title". It was answered by Karl Dewey that same day.

Can someone clarify Karl's answer, meanining, how specifically is this done?
Do I modify the Switchboard Items table by adding a "menu column"? Do I
delete a value in the Command column?

Thanks in advance for the help.
 
K

KARL DEWEY

This is a sample of my Switchboard Items table.
SwitchboardID ItemNumber ItemText Command Argument
1 0 Main Switchboard 0 Default
1 1 Main Menu 1 1
1 2 Process Improvement Ideas 1 2
1 3 Corrective Action Request (CAR) 1 3
1 4 Reports 1 11
1 5 Document Audits -OLD - See Process Audits 1 13
1 6 Performance Audits 1 5
1 7 Walk Throughs 1 19
1 8 Lost Tool Activity 1 4
1 9 Process Audits 1 7
1 10 Table Update 1 6
2 0 Process Improvement Ideas 0 0
2 1 Process Improvement Ideas 1 1
2 2 Add/Update a Process Improvement 3 ProcessImprove-TAB
2 10 Return to Main Menu 1 1
3 0 Corrective Action Request (CAR) 0 0
3 1 Corrective Action Request (CAR) 1 1
3 2 Update Open CAR 3 CAR-Tab
3 3 Add New CAR 3 CAR-Add
3 4 Review Closed CARs 3 CAR-CLOSED
3 10 Return to Main Menu 1 1
4 0 Lost Tools 0
4 1 Lost Tools 0
4 2 Lost Tools Data Entry 3 Lost Tool Data Entry
4 3 Lost Tool Activity Last 12 Months 3 LOST TOOLS DISPLAY
4 8 Return to Main Menu 1 1
5 0 Performance Audits 0 0
5 1 Performance Audits 1 1
5 2 Performance Audits - All 10 Performance Audit Findings and History
5 3 Performance Audits - Active 10 Performance Audit - active

My OptionLabel1 is how I display the menu title. The menu is loaded into the
Switchboard Items table as item 1 of each SwitchboardID. Of course the
command button for options1 is removed. I changed the font (color & size)
and centered in the display.
 
A

Andy

Well, this worked out just great. I am not sure how what I did could have
caused a new problem but now my switchboard no longer works. I get a runtime
error "2110" stating the focus cannot be moved to the control Option1. Here
is what I did...

Opened up the Switchboard Items table
Renumbered the item numbers so I could insert new records ..this is so I
could have the menu be item 1 of each SwitchboardID
I then cut the OptionLabel1 box and repasted it to the form so I could
disconnect the label box from the command button Option1
I then deleted the command button Option1 from the switchboard form
I tried to open the switchboard form but I got a runtime error "2465"
stating the field Option1 referred to in my expression could not be found
So, I clicked on the debug box and saw the focus was set to the Option1
command.....Me![Option1].SetFocus
I changed that command from Option1 to Option2........Me![Option2].SetFocus
I tried to open the switchboard and now got a runtime error "2110" stating
the focus cannot be moved to the control Option2
So, I clicked on the debug box again and changed things back to the initial
settings..to Option1.....Me![Option1].SetFocus
I then added a new command button back to the form and reassociated the
OptionLabel1 to the new command button
I then renamed the new command buttn to Option1
I still get a runtime error stating the focu cannot be moved to Option1..I
think this is because in the VB window there is no Option1

So, any clue how to fix my switchboard, and
what did I do wrong when trying to add the menu to be item 1 in all the
switchboards?
 
A

Andy

Ok, got the switchboard working again...had changed the Visbile control on
the Option1 command button to no. I changed it back to Yes and it works.

Now, back to the original question and figuring out how to get the
switchboard to show my titles.....

Andy said:
Well, this worked out just great. I am not sure how what I did could have
caused a new problem but now my switchboard no longer works. I get a runtime
error "2110" stating the focus cannot be moved to the control Option1. Here
is what I did...

Opened up the Switchboard Items table
Renumbered the item numbers so I could insert new records ..this is so I
could have the menu be item 1 of each SwitchboardID
I then cut the OptionLabel1 box and repasted it to the form so I could
disconnect the label box from the command button Option1
I then deleted the command button Option1 from the switchboard form
I tried to open the switchboard form but I got a runtime error "2465"
stating the field Option1 referred to in my expression could not be found
So, I clicked on the debug box and saw the focus was set to the Option1
command.....Me![Option1].SetFocus
I changed that command from Option1 to Option2........Me![Option2].SetFocus
I tried to open the switchboard and now got a runtime error "2110" stating
the focus cannot be moved to the control Option2
So, I clicked on the debug box again and changed things back to the initial
settings..to Option1.....Me![Option1].SetFocus
I then added a new command button back to the form and reassociated the
OptionLabel1 to the new command button
I then renamed the new command buttn to Option1
I still get a runtime error stating the focu cannot be moved to Option1..I
think this is because in the VB window there is no Option1

So, any clue how to fix my switchboard, and
what did I do wrong when trying to add the menu to be item 1 in all the
switchboards?


KARL DEWEY said:
This is a sample of my Switchboard Items table.
SwitchboardID ItemNumber ItemText Command Argument
1 0 Main Switchboard 0 Default
1 1 Main Menu 1 1
1 2 Process Improvement Ideas 1 2
1 3 Corrective Action Request (CAR) 1 3
1 4 Reports 1 11
1 5 Document Audits -OLD - See Process Audits 1 13
1 6 Performance Audits 1 5
1 7 Walk Throughs 1 19
1 8 Lost Tool Activity 1 4
1 9 Process Audits 1 7
1 10 Table Update 1 6
2 0 Process Improvement Ideas 0 0
2 1 Process Improvement Ideas 1 1
2 2 Add/Update a Process Improvement 3 ProcessImprove-TAB
2 10 Return to Main Menu 1 1
3 0 Corrective Action Request (CAR) 0 0
3 1 Corrective Action Request (CAR) 1 1
3 2 Update Open CAR 3 CAR-Tab
3 3 Add New CAR 3 CAR-Add
3 4 Review Closed CARs 3 CAR-CLOSED
3 10 Return to Main Menu 1 1
4 0 Lost Tools 0
4 1 Lost Tools 0
4 2 Lost Tools Data Entry 3 Lost Tool Data Entry
4 3 Lost Tool Activity Last 12 Months 3 LOST TOOLS DISPLAY
4 8 Return to Main Menu 1 1
5 0 Performance Audits 0 0
5 1 Performance Audits 1 1
5 2 Performance Audits - All 10 Performance Audit Findings and History
5 3 Performance Audits - Active 10 Performance Audit - active

My OptionLabel1 is how I display the menu title. The menu is loaded into the
Switchboard Items table as item 1 of each SwitchboardID. Of course the
command button for options1 is removed. I changed the font (color & size)
and centered in the display.
 
A

Andy

Yes, it did. I now get what I want. Thank you for your help.

However, I still would like to know more about the other solution for
knowledge sakes. I am hoping Karl will respond again.

Thanks again, Jeff!!
 
K

KARL DEWEY

I have modified the visual basic code under the form.

BEWARE it can easily lockup you database. Others say you should stay clear
of doing such things but I ALWAYS backup the database and keep the backup
just in case.

Here is the data from my switchboard form to include the underlying code.
Properties
AllowAdditions: False AllowDatasheetView: True
AllowDeletions: False AllowDesignChanges: False
AllowEditing: True AllowEdits: False
AllowFilters: False AllowFormView: True
AllowPivotChartView: True AllowPivotTableView: True
AllowUpdating: No AutoCenter: True
AutoResize: True Bookmark: Long binary data
BorderStyle: Sizable Caption: Main Switchboard
CloseButton: True Container: Forms
ControlBox: True Count: 29
CurrentRecord: 1 CurrentSectionLeft: 0
CurrentSectionTop: 0 CurrentView: 1
Cycle: All Records DataEntry: False
DatasheetBackColor: 16777215 DatasheetBorderLineStyle: 1
DatasheetCellsEffect: Flat DatasheetColumnHeaderUnde 1
DatasheetFontHeight: 10 DatasheetFontItalic: False
DatasheetFontName: Arial DatasheetFontUnderline: False
DatasheetFontWeight: Normal DatasheetForeColor: 0
DatasheetGridlinesBehavior: Both DatasheetGridlinesColor: 12632256
DateCreated: 4/9/2002 8:28:48 AM DefaultEditing: 3
DefaultView: Single Form Dirty: False
DividingLines: True FastLaserPrinting: True
FetchDefaults: True Filter: [ItemNumber] = 0 AND
[Argument] = 'Default'
FilterOn: True FrozenColumns: 1
GridX: 24 GridY: 24
HasModule: True HelpContextId: 0
HorizontalDatasheetGridlineSt 1 Hwnd: 262686
InsideHeight: 9585 InsideWidth: 15300
KeyPreview: False LastUpdated: 7/29/2003 12:32:09 PM
LayoutForPrint: False LogicalPageWidth: 9360
MaxButton: True MinButton: False
MinMaxButtons: Max Enabled Modal: False
Moveable: True NavigationButtons: False
OnCurrent: [Event Procedure] OnLoad: Maximize
OnOpen: [Event Procedure] OrderByOn: False
Orientation: Left-to-Right Owner: admin
Painting: True PaintPalette: Long binary data
PaletteSource: (Custom) Picture: C:\MSOFFICE\ACCESS\Bitmaps\S
tyles\clouds.wmf
PictureAlignment: 5 PictureData: Long binary data
PicturePalette: Long binary data PictureSizeMode: Stretch
PictureTiling: False PictureType: 0
PopUp: False PrtDevMode: Long binary data
PrtDevNames: Long binary data PrtMip: Long binary data
RecordLocks: No Locks RecordSelectors: False
RecordsetType: Dynaset RecordSource: Switchboard Items
RowHeight: Default ScrollBars: Neither
SelHeight: 0 SelLeft: 1
SelTop: 1 SelWidth: 0
ShortcutMenu: False ShowGrid: True
SubdatasheetExpanded: False SubdatasheetHeight: 0
TimerInterval: 0 UserName: admin
VerticalDatasheetGridlineStyle 1 ViewsAllowed: Both
Visible: True WhatsThisButton: False
Width: 15960 WindowHeight: 10155
WindowLeft: -90 WindowTop: -480
WindowWidth: 15480
Objects
Section: Detail
BackColor: 16777215 CanGrow: False
CanShrink: False DisplayWhen: Always
EventProcPrefix: Detail ForceNewPage: None
HasContinued: False Height: 9780
KeepTogether: False Name: Detail
NewRowOrCol: None SpecialEffect: Flat
Tag: Exit Database Visible: True
WillContinue: False
Command Button: Exit Program
AutoRepeat: False Cancel: False
Caption: Exit Database ControlTipText: Exit Program
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Exit_Program FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 0
Height: 576 HelpContextId: 0
Left: 9420 Name: Exit Program
ObjectPalette: Long binary data OnClick: [Event Procedure]
Picture: (bitmap) PictureData: Long binary data
PictureType: 0 ReadingOrder: Context
Section: 0 StatusBarText: Exit Program
TabIndex: 8 TabStop: True
TextFontCharSet: 0 Top: 7260
Transparent: False Visible: True
Width: 576
Label: Label2
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Process Improvement Ideas,
ControlType: 100 DisplayWhen: Always
EventProcPrefix: Label2 FontBold: No
FontItalic: False FontName: Arial Rounded MT Bold
FontSize: 22 FontUnderline: False
FontWeight: Normal ForeColor: 16744448
Height: 540 HelpContextId: 0
Left: 2887 LeftMargin: 0
LineSpacing: 0 Name: Label2
NumeralShapes: System OldBorderStyle: 0
ReadingOrder: Context RightMargin: 0
Section: 0 SpecialEffect: Flat
TextAlign: Center TextFontCharSet: 0
Top: 180 TopMargin: 0
Vertical: False Visible: True
Width: 7200
Label: Label34
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Exit Database
ControlType: 100 DisplayWhen: Always
EventProcPrefix: Label34 FontBold: Yes
FontItalic: False FontName: Arial
FontSize: 10 FontUnderline: False
FontWeight: Bold ForeColor: 16763904
Height: 420 HelpContextId: 0
Left: 7560 LeftMargin: 0
LineSpacing: 0 Name: Label34
NumeralShapes: System OldBorderStyle: 0
ReadingOrder: Context RightMargin: 0
Section: 0 SpecialEffect: Flat
TextAlign: Right TextFontCharSet: 0
Top: 7320 TopMargin: 0
Vertical: False Visible: True
Width: 1740
Label: Label39
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Corrective Action Request,
ControlType: 100 DisplayWhen: Always
EventProcPrefix: Label39 FontBold: No
FontItalic: False FontName: Arial Rounded MT Bold
FontSize: 22 FontUnderline: False
FontWeight: Normal ForeColor: 16744448
Height: 540 HelpContextId: 0
Left: 2880 LeftMargin: 0
LineSpacing: 0 Name: Label39
NumeralShapes: System OldBorderStyle: 0
ReadingOrder: Context RightMargin: 0
Section: 0 SpecialEffect: Flat
TextAlign: Center TextFontCharSet: 0
Top: 720 TopMargin: 0
Vertical: False Visible: True
Width: 7200
Label: Label40
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Document Audits, Performance Audits,
ControlType: 100 DisplayWhen: Always
EventProcPrefix: Label40 FontBold: No
FontItalic: False FontName: Arial Rounded MT Bold
FontSize: 22 FontUnderline: False
FontWeight: Normal ForeColor: 16744448
Height: 540 HelpContextId: 0
Left: 1905 LeftMargin: 0
LineSpacing: 0 Name: Label40
NumeralShapes: System OldBorderStyle: 0
ReadingOrder: Context RightMargin: 0
Section: 0 SpecialEffect: Flat
TextAlign: Center TextFontCharSet: 0
Top: 1260 TopMargin: 0
Vertical: False Visible: True
Width: 9135
Label: Label51
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: and Walk Throughs
ControlType: 100 DisplayWhen: Always
EventProcPrefix: Label51 FontBold: No
FontItalic: False FontName: Arial Rounded MT Bold
FontSize: 22 FontUnderline: False
FontWeight: Normal ForeColor: 16744448
Height: 540 HelpContextId: 0
Left: 1905 LeftMargin: 0
LineSpacing: 0 Name: Label51
NumeralShapes: System OldBorderStyle: 0
ReadingOrder: Context RightMargin: 0
Section: 0 SpecialEffect: Flat
TextAlign: Center TextFontCharSet: 0
Top: 1920 TopMargin: 0
Vertical: False Visible: True
Width: 9135
Unbound Object Frame: OLEUnbound37
AutoActivate: Double-Click BackColor: 16777215
BackStyle: Transparent BorderColor: 0
BorderLineStyle: Solid BorderStyle: Transparent
BorderWidth: Hairline Class: Word.Document.8
ColumnCount: 0 ColumnHeads: False
ControlType: 114 DisplayType: False
DisplayWhen: Always Enabled: False
EventProcPrefix: OLEUnbound37 Height: 837
HelpContextId: 0 Left: 300
Locked: True LpOleObject: 151534428
Name: OLEUnbound37 ObjectVerbsCount: 3
OldBorderStyle: 0 OLEClass: Microsoft Word 97
OLEType: Embedded OLETypeAllowed: Either
Section: 0 SizeMode: Clip
SpecialEffect: Flat TabIndex: 9
TabStop: True Top: 420
UpdateOptions: Automatic Verb: 0
Visible: True Width: 1676
Command Button: Option1
AutoRepeat: False Cancel: False
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Option1 FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 16711808
Height: 259 HelpContextId: 0
Left: 4512 Name: Option1
OnClick: =HandleButtonClick(1) Picture: (none)
PictureType: 0 ReadingOrder: Context
Section: 0 TabIndex: 0
TabStop: True TextFontCharSet: 0
Top: 0 Transparent: True
Visible: True Width: 529
Command Button: Option10
AutoRepeat: False Cancel: False
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Option10 FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 0
Height: 259 HelpContextId: 0
Left: 2280 Name: Option10
OnClick: =HandleButtonClick(10) Picture: (none)
PictureType: 0 ReadingOrder: Context
Section: 0 TabIndex: 11
TabStop: True TextFontCharSet: 0
Top: 6300 Transparent: False
Visible: True Width: 529
Command Button: Option11
AutoRepeat: False Cancel: False
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Option11 FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 0
Height: 259 HelpContextId: 0
Left: 2280 Name: Option11
OnClick: =HandleButtonClick(10) Picture: (none)
PictureType: 0 ReadingOrder: Context
Section: 0 TabIndex: 12
TabStop: True TextFontCharSet: 0
Top: 6720 Transparent: False
Visible: False Width: 529
Command Button: Option2
AutoRepeat: False Cancel: False
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Option2 FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 13382451
Height: 259 HelpContextId: 0
Left: 2280 Name: Option2
OnClick: =HandleButtonClick(2) Picture: (none)
PictureType: 0 ReadingOrder: Context
Section: 0 TabIndex: 1
TabStop: True TextFontCharSet: 0
Top: 3045 Transparent: False
Visible: True Width: 529
Command Button: Option3
AutoRepeat: False Cancel: False
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Option3 FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 0
Height: 259 HelpContextId: 0
Left: 2280 Name: Option3
OnClick: =HandleButtonClick(3) Picture: (none)
PictureType: 0 ReadingOrder: Context
Section: 0 TabIndex: 2
TabStop: True TextFontCharSet: 0
Top: 3465 Transparent: False
Visible: True Width: 529
Command Button: Option4
AutoRepeat: False Cancel: False
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Option4 FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 0
Height: 259 HelpContextId: 0
Left: 2280 Name: Option4
OnClick: =HandleButtonClick(4) Picture: (none)
PictureType: 0 ReadingOrder: Context
Section: 0 TabIndex: 3
TabStop: True TextFontCharSet: 0
Top: 3885 Transparent: False
Visible: True Width: 529
Command Button: Option5
AutoRepeat: False Cancel: False
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Option5 FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 0
Height: 259 HelpContextId: 0
Left: 2280 Name: Option5
OnClick: =HandleButtonClick(5) Picture: (none)
PictureType: 0 ReadingOrder: Context
Section: 0 TabIndex: 4
TabStop: True TextFontCharSet: 0
Top: 4305 Transparent: False
Visible: True Width: 529
Command Button: Option6
AutoRepeat: False Cancel: False
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Option6 FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 0
Height: 259 HelpContextId: 0
Left: 2280 Name: Option6
OnClick: =HandleButtonClick(6) Picture: (none)
PictureType: 0 ReadingOrder: Context
Section: 0 TabIndex: 5
TabStop: True TextFontCharSet: 0
Top: 4725 Transparent: False
Visible: True Width: 529
Command Button: Option7
AutoRepeat: False Cancel: False
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Option7 FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 0
Height: 259 HelpContextId: 0
Left: 2280 Name: Option7
OnClick: =HandleButtonClick(7) Picture: (none)
PictureType: 0 ReadingOrder: Context
Section: 0 TabIndex: 6
TabStop: True TextFontCharSet: 0
Top: 5145 Transparent: False
Visible: True Width: 529
Command Button: Option8
AutoRepeat: False Cancel: False
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Option8 FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 0
Height: 259 HelpContextId: 0
Left: 2280 Name: Option8
OnClick: =HandleButtonClick(8) Picture: (none)
PictureType: 0 ReadingOrder: Context
Section: 0 TabIndex: 7
TabStop: True TextFontCharSet: 0
Top: 5565 Transparent: False
Visible: True Width: 529
Command Button: Option9
AutoRepeat: False Cancel: False
ControlType: 104 Default: False
DisplayWhen: Always Enabled: True
EventProcPrefix: Option9 FontBold: No
FontItalic: False FontName: MS Sans Serif
FontSize: 8 FontUnderline: False
FontWeight: Normal ForeColor: 0
Height: 259 HelpContextId: 0
Left: 2280 Name: Option9
OnClick: =HandleButtonClick(9) Picture: (none)
PictureType: 0 ReadingOrder: Context
Section: 0 TabIndex: 10
TabStop: True TextFontCharSet: 0
Top: 5940 Transparent: False
Visible: True Width: 529
Label: OptionLabel1
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Main Menu
ControlType: 100 DisplayWhen: Always
EventProcPrefix: OptionLabel1 FontBold: Yes
FontItalic: False FontName: Arial
FontSize: 14 FontUnderline: False
FontWeight: Bold ForeColor: 16711680
Height: 480 HelpContextId: 0
Left: 1920 LeftMargin: 0
LineSpacing: 0 Name: OptionLabel1
NumeralShapes: System OldBorderStyle: 0
OnClick: =HandleButtonClick(1) ReadingOrder: Context
RightMargin: 0 Section: 0
SpecialEffect: Flat TextAlign: Center
TextFontCharSet: 0 Top: 2460
TopMargin: 0 Vertical: False
Visible: True Width: 8160
Label: OptionLabel10
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Table Update
ControlType: 100 DisplayWhen: Always
EventProcPrefix: OptionLabel10 FontBold: Yes
FontItalic: False FontName: Arial
FontSize: 10 FontUnderline: False
FontWeight: Bold ForeColor: 0
Height: 300 HelpContextId: 0
Left: 2910 LeftMargin: 0
LineSpacing: 0 Name: OptionLabel10
NumeralShapes: System OldBorderStyle: 0
OnClick: =HandleButtonClick(10) ReadingOrder: Context
RightMargin: 0 Section: 0
SpecialEffect: Flat TextAlign: General
TextFontCharSet: 0 Top: 6300
TopMargin: 0 Vertical: False
Visible: True Width: 7125
Label: OptionLabel11
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 ControlType: 100
DisplayWhen: Always EventProcPrefix: OptionLabel11
FontBold: Yes FontItalic: False
FontName: Arial FontSize: 10
FontUnderline: False FontWeight: Bold
ForeColor: 0 Height: 300
HelpContextId: 0 Left: 2910
LeftMargin: 0 LineSpacing: 0
Name: OptionLabel11 NumeralShapes: System
OldBorderStyle: 0 OnClick: =HandleButtonClick(10)
ReadingOrder: Context RightMargin: 0
Section: 0 SpecialEffect: Flat
TextAlign: General TextFontCharSet: 0
Top: 6720 TopMargin: 0
Vertical: False Visible: False
Width: 7125
Label: OptionLabel2
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Process Improvement Ideas
ControlType: 100 DisplayWhen: Always
EventProcPrefix: OptionLabel2 FontBold: Yes
FontItalic: False FontName: Arial
FontSize: 10 FontUnderline: False
FontWeight: Bold ForeColor: 0
Height: 300 HelpContextId: 0
Left: 2910 LeftMargin: 0
LineSpacing: 0 Name: OptionLabel2
NumeralShapes: System OldBorderStyle: 0
OnClick: =HandleButtonClick(2) ReadingOrder: Context
RightMargin: 0 Section: 0
SpecialEffect: Flat TextAlign: General
TextFontCharSet: 0 Top: 3045
TopMargin: 0 Vertical: False
Visible: True Width: 7125
Label: OptionLabel3
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Corrective Action Request (CAR)
ControlType: 100 DisplayWhen: Always
EventProcPrefix: OptionLabel3 FontBold: Yes
FontItalic: False FontName: Arial
FontSize: 10 FontUnderline: False
FontWeight: Bold ForeColor: 0
Height: 300 HelpContextId: 0
Left: 2910 LeftMargin: 0
LineSpacing: 0 Name: OptionLabel3
NumeralShapes: System OldBorderStyle: 0
OnClick: =HandleButtonClick(3) ReadingOrder: Context
RightMargin: 0 Section: 0
SpecialEffect: Flat TextAlign: General
TextFontCharSet: 0 Top: 3465
TopMargin: 0 Vertical: False
Visible: True Width: 7125
Label: OptionLabel4
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Reports
ControlType: 100 DisplayWhen: Always
EventProcPrefix: OptionLabel4 FontBold: Yes
FontItalic: False FontName: Arial
FontSize: 10 FontUnderline: False
FontWeight: Bold ForeColor: 0
Height: 300 HelpContextId: 0
Left: 2910 LeftMargin: 0
LineSpacing: 0 Name: OptionLabel4
NumeralShapes: System OldBorderStyle: 0
OnClick: =HandleButtonClick(4) ReadingOrder: Context
RightMargin: 0 Section: 0
SpecialEffect: Flat TextAlign: General
TextFontCharSet: 0 Top: 3885
TopMargin: 0 Vertical: False
Visible: True Width: 7125
Label: OptionLabel5
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Document Audits -OLD - See Process Audits
ControlType: 100 DisplayWhen: Always
EventProcPrefix: OptionLabel5 FontBold: Yes
FontItalic: False FontName: Arial
FontSize: 10 FontUnderline: False
FontWeight: Bold ForeColor: 0
Height: 300 HelpContextId: 0
Left: 2910 LeftMargin: 0
LineSpacing: 0 Name: OptionLabel5
NumeralShapes: System OldBorderStyle: 0
OnClick: =HandleButtonClick(5) ReadingOrder: Context
RightMargin: 0 Section: 0
SpecialEffect: Flat TextAlign: General
TextFontCharSet: 0 Top: 4305
TopMargin: 0 Vertical: False
Visible: True Width: 7125
Label: OptionLabel6
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Performance Audits
ControlType: 100 DisplayWhen: Always
EventProcPrefix: OptionLabel6 FontBold: Yes
FontItalic: False FontName: Arial
FontSize: 10 FontUnderline: False
FontWeight: Bold ForeColor: 0
Height: 300 HelpContextId: 0
Left: 2910 LeftMargin: 0
LineSpacing: 0 Name: OptionLabel6
NumeralShapes: System OldBorderStyle: 0
OnClick: =HandleButtonClick(6) ReadingOrder: Context
RightMargin: 0 Section: 0
SpecialEffect: Flat TextAlign: General
TextFontCharSet: 0 Top: 4725
TopMargin: 0 Vertical: False
Visible: True Width: 7125
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Walk Throughs
ControlType: 100 DisplayWhen: Always
EventProcPrefix: OptionLabel7 FontBold: Yes
FontItalic: False FontName: Arial
FontSize: 10 FontUnderline: False
FontWeight: Bold ForeColor: 0
Height: 300 HelpContextId: 0
Left: 2910 LeftMargin: 0
LineSpacing: 0 Name: OptionLabel7
NumeralShapes: System OldBorderStyle: 0
OnClick: =HandleButtonClick(7) ReadingOrder: Context
RightMargin: 0 Section: 0
SpecialEffect: Flat TextAlign: General
TextFontCharSet: 0 Top: 5145
TopMargin: 0 Vertical: False
Visible: True Width: 7125
Label: OptionLabel8
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Lost Tool Activity
ControlType: 100 DisplayWhen: Always
EventProcPrefix: OptionLabel8 FontBold: Yes
FontItalic: False FontName: Arial
FontSize: 10 FontUnderline: False
FontWeight: Bold ForeColor: 0
Height: 300 HelpContextId: 0
Left: 2910 LeftMargin: 0
LineSpacing: 0 Name: OptionLabel8
NumeralShapes: System OldBorderStyle: 0
OnClick: =HandleButtonClick(8) ReadingOrder: Context
RightMargin: 0 Section: 0
SpecialEffect: Flat TextAlign: General
TextFontCharSet: 0 Top: 5565
TopMargin: 0 Vertical: False
Visible: True Width: 7125
Label: OptionLabel9
BackColor: 16777215 BackStyle: Transparent
BorderColor: 0 BorderLineStyle: Solid
BorderStyle: Transparent BorderWidth: Hairline
BottomMargin: 0 Caption: Process Audits
ControlType: 100 DisplayWhen: Always
EventProcPrefix: OptionLabel9 FontBold: Yes
FontItalic: False FontName: Arial
FontSize: 10 FontUnderline: False
FontWeight: Bold ForeColor: 0
Height: 300 HelpContextId: 0
Left: 2910 LeftMargin: 0
LineSpacing: 0 Name: OptionLabel9
NumeralShapes: System OldBorderStyle: 0
OnClick: =HandleButtonClick(9) ReadingOrder: Context
RightMargin: 0 Section: 0
SpecialEffect: Flat TextAlign: General
TextFontCharSet: 0 Top: 5940
TopMargin: 0 Vertical: False
Visible: True Width: 7125
 
K

KARL DEWEY

Code
1 VERSION 1.0 CLASS
2 BEGIN
3 MultiUse = -1 'True
4 END
5 Attribute VB_Name = "Form_Switchboard"
6 Attribute VB_GlobalNameSpace = False
7 Attribute VB_Creatable = True
8 Attribute VB_PredeclaredId = True
9 Attribute VB_Exposed = False
10 Option Compare Database
11 Option Explicit
12
13 Private Sub Form_Open(Cancel As Integer)
14 ' Minimize the database window and initialize the form.
15
16 ' Move to the switchboard page that is marked as the default.
17 Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
18 Me.FilterOn = True
19
20 End Sub
21
22 Private Sub Form_Current()
23 ' Update the caption and fill in the list of options.
24
25 Me.Caption = Nz(Me![ItemText], "")
26 FillOptions
27
28 End Sub
29
30 Private Sub FillOptions()
31 ' Fill in the options for this switchboard page.
32
33 ' The number of buttons on the form.
34 Const conNumButtons = 10
35
36 Dim dbs As Database
37 Dim rst As Recordset
38 Dim strSQL As String
39 Dim intOption As Integer
40
41 ' Set the focus to the first button on the form,
42 ' and then hide all of the buttons on the form
43 ' but the first. You can't hide the field with the focus.
44 Me![Option1].SetFocus
45 For intOption = 2 To conNumButtons
46 Me("Option" & intOption).Visible = False
47 Me("OptionLabel" & intOption).Visible = False
48 Next intOption
49
50 ' Open the table of Switchboard Items, and find
51 ' the first item for this Switchboard Page.
52 Set dbs = CurrentDb()
53 strSQL = "SELECT * FROM [Switchboard Items]"
54 strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" &
Me![SwitchboardID]
55 strSQL = strSQL & " ORDER BY [ItemNumber];"
56 Set rst = dbs.OpenRecordset(strSQL)
57
58 ' If there are no options for this Switchboard Page,
59 ' display a message. Otherwise, fill the page with the items.
60 If (rst.EOF) Then
61 Me![OptionLabel1].Caption = "There are no items for this
switchboard page"
62 Else
63 While (Not (rst.EOF))
64 Me("Option" & rst![ItemNumber]).Visible = True
65 Me("OptionLabel" & rst![ItemNumber]).Visible = True
66 Me("OptionLabel" & rst![ItemNumber]).Caption = rst![ItemText]
67 rst.MoveNext
68 Wend
69 End If
70
71 ' Close the recordset and the database.
72 rst.Close
73 dbs.Close
74
75 End Sub
76
77 Private Function HandleButtonClick(intBtn As Integer)
78 ' This function is called when a button is clicked.
79 ' intBtn indicates which button was clicked.
80
81 ' Constants for the commands that can be executed.
82 Const conCmdGotoSwitchboard = 1
83 Const conCmdOpenFormAdd = 2
84 Const conCmdOpenFormBrowse = 3
85 Const conCmdOpenReport = 4
86 Const conCmdCustomizeSwitchboard = 5
87 Const conCmdExitApplication = 6
88 Const conCmdRunMacro = 7
89 Const conCmdRunCode = 8
90 Const conCmdOpentableEdit = 9
91 Const conCmdOpenFormView = 10
92 Const conCmdOpenFormData = 11
93
94 ' An error that is special cased.
95 Const conErrDoCmdCancelled = 2501
96
97 Dim dbs As Database
98 Dim rst As Recordset
99
100 On Error GoTo HandleButtonClick_Err
101
102 ' Find the item in the Switchboard Items table
103 ' that corresponds to the button that was clicked.
104 Set dbs = CurrentDb()
105 Set rst = dbs.OpenRecordset("Switchboard Items", dbOpenDynaset)
106 rst.FindFirst "[SwitchboardID]=" & Me![SwitchboardID] & " AND
[ItemNumber]=" & intBtn
107
108 ' If no item matches, report the error and exit the function.
109 If (rst.NoMatch) Then
110 MsgBox "There was an error reading the Switchboard Items table."
111 rst.Close
112 dbs.Close
113 Exit Function
114 End If
115
116 Select Case rst![Command]
117
118 ' Go to another switchboard.
119 Case conCmdGotoSwitchboard
120 Me.Filter = "[ItemNumber] = 0 AND [SwitchboardID]=" &
rst![Argument]
121
122 ' Open a form in Add mode.
123 Case conCmdOpenFormAdd
124 DoCmd.OpenForm rst![Argument], , , , acAdd
125
126 ' Open a form.
127 Case conCmdOpenFormBrowse
128 DoCmd.OpenForm rst![Argument]
129
130 ' Open a form-view.
131 Case conCmdOpenFormView
132 DoCmd.OpenForm rst![Argument], acNormal
133
134 ' Open a form Datasheet
135 Case conCmdOpenFormData
136 DoCmd.OpenForm rst![Argument], acFormDS
137
138 ' Open a table.
139 Case conCmdOpentableEdit
140 DoCmd.OpenTable rst![Argument], acViewNormal
141
142 ' Open a report.
143 Case conCmdOpenReport
144 DoCmd.OpenReport rst![Argument], acPreview
145
146 ' Customize the Switchboard.
147 Case conCmdCustomizeSwitchboard
148 ' Handle the case where the Switchboard Manager
149 ' is not installed (e.g. Minimal Install).
150 On Error Resume Next
151 Application.Run "WZMAIN70.sbm_Entry"
152 If (Err <> 0) Then MsgBox "Command not available."
153 On Error GoTo 0
154 ' Update the form.
155 Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
156 Me.Caption = Nz(Me![ItemText], "")
157 FillOptions
158
159 ' Exit the application.
160 Case conCmdExitApplication
161 CloseCurrentDatabase
162
163 ' Run a macro.
164 Case conCmdRunMacro
165 DoCmd.RunMacro rst![Argument]
166
167 ' Run code.
168 Case conCmdRunCode
169 Application.Run rst![Argument]
170
171 ' Any other command is unrecognized.
172 Case Else
173 MsgBox "Unknown option."
174
175 End Select
176
177 ' Close the recordset and the database.
178 rst.Close
179 dbs.Close
180
181 HandleButtonClick_Exit:
182 Exit Function
183
184 HandleButtonClick_Err:
185 ' If the action was cancelled by the user for
186 ' some reason, don't display an error message.
187 ' Instead, resume on the next line.
188 If (Err = conErrDoCmdCancelled) Then
189 Resume Next
190 Else
191 MsgBox "There was an error executing the command.", vbCritical
192 Resume HandleButtonClick_Exit
193 End If
194
195 End Function
196 Sub Exit_Program_Click()
197 On Error GoTo Err_Exit_Program_Click
198
199
200 DoCmd.Quit
201
202 Exit_Exit_Program_Click:
203 Exit Sub
204
205 Err_Exit_Program_Click:
206 MsgBox Err.Description
207 Resume Exit_Exit_Program_Click
208
209 End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top