switchboard problem (convert from access2000 to access97)

  • Thread starter marco_pb via AccessMonster.com
  • Start date
M

marco_pb via AccessMonster.com

I've got a problem here...
I'm converting this file from access 2000 to access 1997. The previous
switchboard won't work, so I create new switchboard in access 97 (after
converting). I don't know why it won't work..
could somebody help me????? thx a lot before. I really appreciate your help.
thank you

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 [Übersichtseinträge]"
strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me!
[SwitchboardID]
strSQL = strSQL & " ORDER BY [ItemNumber];"
=> ERROR 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 = "Für diese Übersichtsseite gibt es keine
Einträge."
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
 
R

RoyVidar

marco_pb via AccessMonster.com wrote in message said:
I've got a problem here...
I'm converting this file from access 2000 to access 1997. The previous
switchboard won't work, so I create new switchboard in access 97 (after
converting). I don't know why it won't work..
could somebody help me????? thx a lot before. I really appreciate your help.
thank you

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 [Übersichtseinträge]"
strSQL = strSQL & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me!
[SwitchboardID]
strSQL = strSQL & " ORDER BY [ItemNumber];"
=> ERROR 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 = "Für diese Übersichtsseite gibt es keine
Einträge."
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

You might perhaps have both ADO and DAO referenced in the db, then it
is perhaps better to be explicit in the declarations. That's if the
error is Type mismatch.

Dim dbs As DAO.Database
Dim rst As DAO.Recordset
 
M

marco_pb via AccessMonster.com

thanks to all...

insist of doing nothing, I create a new access97 database. Here I got a new
problem, should I post it here or create a new post?
the problem is about the after update code in VB

thanks before for everything ^^
 

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