Access Switch Board
Wizard Information

Getting The Heading To Reflect The Title Of The Current Switchboard Page

  1. Design the form titled Switchboard (This form is used to display all of the switchboard pages).
  2. View the form's code.
  3. Edit the FillOptions sub routine
  4. Change the characters > 0 in the text that reads
  5. strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]

    to >= 0

  6. Replace the code that starts with `If there are no options and ends with
  7. Wend
    End If

    With the following code

    'If there are no options for this Switchboard Page,
    'display a message.  Otherwise, fill the page with the items and
    'adjust the heading.

    If (rst.EOF) Then
        Me![OptionLabel1].Caption = "There are no items for this
        switchboard page"
    Else
        While (Not (rst.EOF))
        If rst![ItemNumber] = 0 And rst![SwitchboardID] > Then
           Label1.Caption = rst![ItemText]
           Label2.Caption = rst![ItemText]
        End If

        If rst![ItemNumber] > 0 Then
           Me("Option" &  rst![ItemNumber]).Visible = True
           Me("OptionLabel" &  rst![ItemNumber]).Visible = True
           Me("OptionLabel" &  rst![ItemNumber]).Caption =
           rst![ItemText]
        End If
        rst.MoveNext
        Wend
    End If

  8. Edit the Current event for the Form object.
  9. Create a blank line under the second line and add the text
  10. Label1.Caption = "title"
    Label2.Caption = "title"

    replacing title with the text you would like to appear in the heading when the first page of the switchboard is active.

    How To Add More Than 8 Items To Any Switchboard Page

  1. Design the form titled Switchboard (This form is used to display all of the switchboard pages).
  2. Use the Duplicate pick on the Edit menu to duplicate the last button and label for each item past the first 8 you will have.
  3. Change the name of each new button to read OptionN where N is its number.
  4. Change the name of each new label to read OptionLabelN where N is its number.
  5. Move the new labels and controls up or down so there is the same amount of space between them as the old ones.
  6. Adjust the left properties of the new buttons and then the new labels to match the old ones.
  7. View the form's code.
  8. Edit the FillOptions sub routine.
  9. Change the line reading Const conNumButtons = 8 to Const conNumButtons =  N where n is the number of buttons on the form.

These steps only allow more items to be displayed on the Switchboard form.  Once they are done the switch board wizard will still not let you add more than 8 items per page, but you can add them by editing the table Switchboard Items.  Any new items you place in this table will show up in the switchboard manager dialog boxes.

Lila Godel's Web Site
Brought To You By Hamilton Services, Inc.

Contact Me

Access

Access

Home

Home

Links

Links

Miscellaneous

Other

Programs By Me

Programs

Visual Basic

Visual Basic

Windows

Windows