Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002

    Question Unanswered: Switchboard error

    I created a small Access 2000 application (3 forms + switchboard, 4 tables, and 1 report) several weeks ago; and I used the switchboard wizard to create a nice simple interface. Works fine. Except today I tried to run the app because I need to enhance it, and now the the switchboard bombs! (See code below)

    However other people don't have a problem with it. I get this error: run-time error '3001':
    Application-defined or object-defined error.

    When I click the "debug" button, I jump into the FillOptions code listed below. The problem is with the line:
    Set rs = CreateObject("ADODB.Recordset")

    I tried importing everything, recreating the switchboard, repairing and compacting the db, etc, and nothing works. I tried creating a new database with just a switchboard, which has a button that does nothing but exit, and I still get the same error. I tried opening other databases with switchboards and get the same error. I tried running Office repair...I tried uninstalling...Access won't uninstall. The Sys Admin person is gone for the night...I really don't want to have to rebuild my box...etc. Oh, yeah, I have rebooted. (Windows NT 4, Office 2000, SR1, SP2)

    Please, anyone, help! ...and thank you.


    Private Sub FillOptions()
    ' Fill in the options for this switchboard page.

    ' The number of buttons on the form.
    Const conNumButtons = 8

    Dim con As Object
    Dim rs As Object
    Dim stSql As String
    Dim intOption As Integer

    ' Set the focus to the first button on the form,
    ' and then hide all of the buttons on the form
    ' but the first. You can't hide the field with the focus.
    For intOption = 2 To conNumButtons
    Me("Option" & intOption).Visible = False
    Me("OptionLabel" & intOption).Visible = False
    Next intOption

    ' Open the table of Switchboard Items, and find
    ' the first item for this Switchboard Page.
    Set con = Application.CurrentProject.Connection
    stSql = "SELECT * FROM [Switchboard Items]"
    stSql = stSql & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
    stSql = stSql & " ORDER BY [ItemNumber];"
    Set rs = CreateObject("ADODB.Recordset")
    rs.Open stSql, con, 1 ' 1 = adOpenKeyset

    ' If there are no options for this Switchboard Page,
    ' display a message. Otherwise, fill the page with the items.
    If (rs.EOF) Then
    Me![OptionLabel1].Caption = "There are no items for this switchboard page"
    While (Not (rs.EOF))
    Me("Option" & rs![ItemNumber]).Visible = True
    Me("OptionLabel" & rs![ItemNumber]).Visible = True
    Me("OptionLabel" & rs![ItemNumber]).Caption = rs![ItemText]
    End If

    ' Close the recordset and the database.
    Set rs = Nothing
    Set con = Nothing

    End Sub

  2. #2
    Join Date
    Oct 2002
    Since getting this error, Office2000 has been reinstalled, but alas, the problem is still there. What I have discovered is that I can use a sample database with a working switchboard, import my objects, modify the switchboard for my needs, and it will continue to work. Seems I just can't build one with scratch. Oh yeah, I can't import a working switchboard and get it to work either. I can only work with an existing database with a functioning switchboard.

  3. #3
    Join Date
    Oct 2002

    Thumbs up

    Just downloaded MDAC 2.5 SP2 from Microsoft and that seems to have fixed the problem.
    Last edited by jsorense; 11-04-02 at 13:49.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts