R
Richard
Greetings,
After splitting the database and using the upsize wizard I received the
following error from a popup window, run-time error '91': Object variable or
block variable not set. This is has to do with the switchboard. This is the
place where the debugger stops. Set rst = dbs.OpenRecordset(strSql)
code********************************************************
Private Sub FillOptions()
' Fill in the options for this switchboard page.
' The number of buttons on the form.
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].Visible = True
Me![Command1].Enabled = True
Me![Command1].SetFocus
With Me![OptionLabel1]
.Visible = True
.FontWeight = conFontWeightBold
End With
For intOption = 2 To conNumButtons
Me("Option" & intOption).Visible = False
Me("OptionLabel" & intOption).Visible = False
Me("OptionLabel" & intOption).FontWeight = conFontWeightNormal
Me("Command" & intOption).Enabled = 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("OptionLabel" & rst![ItemNumber]).Visible = True
Me("OptionLabel" & rst![ItemNumber]).Caption = rst![ItemText]
Me("Command" & rst![ItemNumber]).Enabled = True
rst.MoveNext
Wend
End If
' Close the recordset and the database.
rst.Close
dbs.Close
End Sub
************************************************************
Any suggestions would be very much appreciated.
Thank You.
After splitting the database and using the upsize wizard I received the
following error from a popup window, run-time error '91': Object variable or
block variable not set. This is has to do with the switchboard. This is the
place where the debugger stops. Set rst = dbs.OpenRecordset(strSql)
code********************************************************
Private Sub FillOptions()
' Fill in the options for this switchboard page.
' The number of buttons on the form.
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].Visible = True
Me![Command1].Enabled = True
Me![Command1].SetFocus
With Me![OptionLabel1]
.Visible = True
.FontWeight = conFontWeightBold
End With
For intOption = 2 To conNumButtons
Me("Option" & intOption).Visible = False
Me("OptionLabel" & intOption).Visible = False
Me("OptionLabel" & intOption).FontWeight = conFontWeightNormal
Me("Command" & intOption).Enabled = 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("OptionLabel" & rst![ItemNumber]).Visible = True
Me("OptionLabel" & rst![ItemNumber]).Caption = rst![ItemText]
Me("Command" & rst![ItemNumber]).Enabled = True
rst.MoveNext
Wend
End If
' Close the recordset and the database.
rst.Close
dbs.Close
End Sub
************************************************************
Any suggestions would be very much appreciated.
Thank You.