S
Sprinks
I accidentally deleted my Switchboard form. If I go to Tools/Database
Utilities/Switchboard Manager, my definitions are still there. And my
Switchboard Items table is still intact. But the form itself that displays
and acts on the selections has been deleted.
I tried:
- manually deleting the Switchboard Items table, and starting the
switchboard from scratch. Access adds the new items to the table and
recreates the form, but the form comes up with one button called "There are
no items for this switchboard page". If I click on it, it says there was an
error reading the Switchboard Items table, however, the table exists, and
appears to have valid data.
- Importing & linking all necessary tables and forms OTHER than Switchboard
Items and the Switchboard form, and creating them from scratch. Same result
as above.
- Above, compacting & repairing the database prior to recreating the
switchboard. Same result.
Looking at the HandleButtonClick code, it seems to be having trouble with
the following lines:
Set con = Application.CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")
stSql = "SELECT * FROM [Switchboard Items] "
stSql = stSql & "WHERE [SwitchboardID]=" & Me![SwitchboardID] & " AND
[ItemNumber]=" & intBtn
MsgBox stSql
rs.Open stSql, con, 1 ' 1 = adOpenKeyset
' If no item matches, report the error and exit the function.
If (rs.EOF) Then
MsgBox "There was an error reading the Switchboard Items table."
My inserted message box statement indicates that both items are equal to 1.
I suspected, since I've never used a switchboard with this database that I
was missing a reference, presumably ADO, so I added one for Microsoft ActiveX
Data Objects Library 2.8, with no change.
The Switchboard Items table is:
Switchboard Items
SwitchboardID ItemNumber ItemText Command Argument
1 0 Main Switchboard Default
2 0 Add New Records 0
2 1 Projects 2 frmProjects
Baffling. I certainly would appreciate all help.
Sprinks
Utilities/Switchboard Manager, my definitions are still there. And my
Switchboard Items table is still intact. But the form itself that displays
and acts on the selections has been deleted.
I tried:
- manually deleting the Switchboard Items table, and starting the
switchboard from scratch. Access adds the new items to the table and
recreates the form, but the form comes up with one button called "There are
no items for this switchboard page". If I click on it, it says there was an
error reading the Switchboard Items table, however, the table exists, and
appears to have valid data.
- Importing & linking all necessary tables and forms OTHER than Switchboard
Items and the Switchboard form, and creating them from scratch. Same result
as above.
- Above, compacting & repairing the database prior to recreating the
switchboard. Same result.
Looking at the HandleButtonClick code, it seems to be having trouble with
the following lines:
Set con = Application.CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")
stSql = "SELECT * FROM [Switchboard Items] "
stSql = stSql & "WHERE [SwitchboardID]=" & Me![SwitchboardID] & " AND
[ItemNumber]=" & intBtn
MsgBox stSql
rs.Open stSql, con, 1 ' 1 = adOpenKeyset
' If no item matches, report the error and exit the function.
If (rs.EOF) Then
MsgBox "There was an error reading the Switchboard Items table."
My inserted message box statement indicates that both items are equal to 1.
I suspected, since I've never used a switchboard with this database that I
was missing a reference, presumably ADO, so I added one for Microsoft ActiveX
Data Objects Library 2.8, with no change.
The Switchboard Items table is:
Switchboard Items
SwitchboardID ItemNumber ItemText Command Argument
1 0 Main Switchboard Default
2 0 Add New Records 0
2 1 Projects 2 frmProjects
Baffling. I certainly would appreciate all help.
Sprinks