Still Having Trouble With Switchboard

G

Guest

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
 
J

Jeff Boyce

Sprinks

A couple thoughts:

Do you have a backup copy of your work? If not, I bet you wish you did <g>!
There's always next time.

Could you simply delete all the pieces and rebuild the switchboard?

Have you considered creating your own "Main Menu" form? Doing this may give
you more control over function and display than you have by using the canned
Switchboard Manager.

Good luck

Jeff Boyce
<Access MVP>
 
G

Guest

Jeff,

Thank you for your response.

Yes, I have a backup and may have to use it, however, I was trying to make
what had been a standalone personal app to sharing it with the rest of my
department. So I'd modified quite a number of forms first to make them more
consistent and attractive afterwhich I ran into the problem. I'd like to
avoid redoing them but may have no choice.

I've tried deleting all the pieces.

While a custom menu form certainly gives me more control, the canned SB was
presumably more convenient, particularly for this "quick and dirty" app.

Jeff Boyce said:
Sprinks

A couple thoughts:

Do you have a backup copy of your work? If not, I bet you wish you did <g>!
There's always next time.

Could you simply delete all the pieces and rebuild the switchboard?

Have you considered creating your own "Main Menu" form? Doing this may give
you more control over function and display than you have by using the canned
Switchboard Manager.

Good luck

Jeff Boyce
<Access MVP>

Sprinks said:
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
 

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