Run-time error '-2147221164 (80040154)':

staplersarecool

New member
Local time
Today, 09:38
Joined
Mar 13, 2008
Messages
2
Ibelieve this is linked to the "switchboard" MS Access will not open a db which itself opens with a switchboard, if you accept the offer to "debug" you can simply delete the line of text from the VB Screen the the database then works fine.
I think the problem is a lost dll

All other forms open an function normally. I have tried a "repair" using the installation disc but to no avail.

Can anybody help.
 
what does the error tell you and what line is it pointing to (highlight) when you do select Debug?

.
 
Private Sub Form_Open(CANCEL As Integer)
' Minimize the database window and initialize the form.

' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True

End Sub

Private Sub Form_Current()
' Update the caption and fill in the list of options.

Me.Caption = Nz(Me![ItemText], "")
FillOptions

End Sub

Private Sub FillOptions()
' Fill in the options for this switchboard page.

' The number of buttons on the form.
Const conNumButtons = 8

Dim con As Object
Dim rs As Object
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 = Application.CurrentProject.Connection
stSql = "SELECT * FROM [Switchboard Items]"
stSql = stSql & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
stSql = stSql & " ORDER BY [ItemNumber];"


Thanks the following is the code that the dubug sends me. I cannot complete a Compact and Repair as it stops at the same point and sends me to the spot.
The line marked with the asterics is the yellow highlighted line of code.

Set rs = CreateObject("ADODB.Recordset")


' If there are no options for this Switchboard Page,
' display a message. Otherwise, fill the page with the items.
If (rs.EOF) Then **************************************
Me![OptionLabel1].Caption = "There are no items for this switchboard page"
Else
While (Not (rs.EOF))
Me("Option" & rs![ItemNumber]).Visible = True
Me("OptionLabel" & rs![ItemNumber]).Visible = True
Me("OptionLabel" & rs![ItemNumber]).Caption = rs![ItemText]
rs.MoveNext
Wend
End If

' Close the recordset and the database.
rs.Close
Set rs = Nothing
Set con = Nothing

End Sub
 

Users who are viewing this thread

Back
Top Bottom