How to rid Switchboard Error from 95's and 98's 
Author Message
 How to rid Switchboard Error from 95's and 98's

I have Access 97 on a 2000 Windows operating computer.  I just did an update to
my front end.  It works great on other computers that have 2000 but fails on
the 1995 and 1998 Windows computers.  The failure comes up in the Switchboard
code:

A compile error occurs on the line: "Dim dbs As Database" line below (5 lines
down).  I'll give the whole code, however:

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

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

    Dim dbs As Database
    Dim rst As Recordset
    Dim strSQL 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.
    Me![Option1].SetFocus
    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 dbs = CurrentDb()
    strSQL = "SELECT * FROM [Switchboard Items]"
    strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" &
Me![SwitchboardID]
    strSQL = strSQL & " ORDER BY [ItemNumber];"
    Set rst = dbs.OpenRecordset(strSQL)

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

    ' Close the recordset and the database.
    rst.Close
    dbs.Close

End Sub
__________________

Thanks,

Matt



Tue, 26 Jul 2005 02:01:29 GMT  
 How to rid Switchboard Error from 95's and 98's

Check your reference to the DAO lib

ChrisB
MCDBA MCSE
www.MyDBA2000.com

Quote:
>-----Original Message-----
>I have Access 97 on a 2000 Windows operating computer.  I

just did an update to
Quote:
>my front end.  It works great on other computers that

have 2000 but fails on
Quote:
>the 1995 and 1998 Windows computers.  The failure comes

up in the Switchboard
Quote:
>code:

>A compile error occurs on the line: "Dim dbs As Database"
line below (5 lines
>down).  I'll give the whole code, however:

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

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

>    Dim dbs As Database
>    Dim rst As Recordset
>    Dim strSQL 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.
>    Me![Option1].SetFocus
>    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 dbs = CurrentDb()
>    strSQL = "SELECT * FROM [Switchboard Items]"
>    strSQL = strSQL & " WHERE [ItemNumber] > 0 AND
[SwitchboardID]=" &
>Me![SwitchboardID]
>    strSQL = strSQL & " ORDER BY [ItemNumber];"
>    Set rst = dbs.OpenRecordset(strSQL)

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

>    ' Close the recordset and the database.
>    rst.Close
>    dbs.Close

>End Sub
>__________________

>Thanks,

>Matt

>.



Tue, 26 Jul 2005 04:28:16 GMT  
 How to rid Switchboard Error from 95's and 98's

Quote:
>Check your reference to the DAO lib

But how do I get the Reference menu to come up when it is stuck on this error?
I can't close the module.

I have a similar problem where I have to click than unclid the DAO lib.  Is
this the same thing?  

Thanks,

Matt



Tue, 26 Jul 2005 05:48:40 GMT  
 How to rid Switchboard Error from 95's and 98's
Hold the Shift Key down while you open the database.  This will open your
database with the Access Container window and the standard MenuBar.

You need the DAO Library in the References Collection for your code to work.

Did you convert the database to A2K format?

--
HTH
Van T. Dinh
MVP (Access)


Quote:
> >Check your reference to the DAO lib

> But how do I get the Reference menu to come up when it is stuck on this
error?
> I can't close the module.

> I have a similar problem where I have to click than unclid the DAO lib.
Is
> this the same thing?

> Thanks,

> Matt



Tue, 26 Jul 2005 07:51:42 GMT  
 How to rid Switchboard Error from 95's and 98's
Thanks.  I've going on vacation but I will forward your comments to my tech.  

Matt.



Tue, 26 Jul 2005 10:19:58 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Login Off's In Windows '95/'98

2. Korean Windows 98/95 and lot's of trouble

3. Application runs with Windows 95/NT, but doesn't work with Windows 98

4. Default printer fonts for Win '95/98 not working

5. Printing in Win'95/98

6. OCX won't register under 95 but will in 98/NT

7. windows 95/98 ok but NT file error

8. Error 68 accessing floppy disk under Win 95, 98, ME

9. Error in NT, but not 95/98

10. HELP - Error 50003 - VB5, Win 95, Win 98, Win NT

11. HELP - Error 50003 - VB5, Win 95, Win 98, Win NT

12. HELP - Error 50003 - VB5, Win 95, Win 98, Win NT

 

 
Powered by phpBB® Forum Software