Diogenes
23-07-2008, 05:17 PM
I have an access database, with a switchboard (created using the 'Switchboard Manager').
The dbase is used by several staff throughout our office, and has work fine for last few years.
Now, one of the staff has had their PC replaced, and the whenever they try to open the switchboard form, they get a run time error '430'.
My first thought was that there was something funny with my code. BUT, I created a blank dbase, and ran the switchboard manager to create a new switchboard, and the same thing happens.
Code snippet:
Private Sub FillOptions()
' Fill in the options for this switchboard page.
' The number of buttons on the form.
Const conNumButtons = 8
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
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.
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 con = 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
The problem lies with Set con = CurrentProject.Connection
I have googled galore, but found no answers, so please help......
The dbase is used by several staff throughout our office, and has work fine for last few years.
Now, one of the staff has had their PC replaced, and the whenever they try to open the switchboard form, they get a run time error '430'.
My first thought was that there was something funny with my code. BUT, I created a blank dbase, and ran the switchboard manager to create a new switchboard, and the same thing happens.
Code snippet:
Private Sub FillOptions()
' Fill in the options for this switchboard page.
' The number of buttons on the form.
Const conNumButtons = 8
Dim con As ADODB.Connection
Dim rs As ADODB.Recordset
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.
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 con = 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
The problem lies with Set con = CurrentProject.Connection
I have googled galore, but found no answers, so please help......