G
Guest
I’m getting the error “Procedure declaration does not match description of
event or procedure having the same name†in some code I’m modifying, and I
can’t figure out why. This first sub works fine; it populates a listbox with
the columns of a table in a database:
Sub TablesList_Click()
Dim conn As Connection
Dim rs As Recordset
Dim strTbl As String
ColumnsList.Clear
Set conn = New Connection
conn.ConnectionString = strConnection
strTbl = TablesList.List(TablesList.ListIndex)
conn.Open
Set rs = conn.OpenSchema(adSchemaColumns, Array(Empty, Empty, strTbl,
Empty))
While Not rs.EOF
ColumnsList.AddItem (rs("COLUMN_NAME"))
rs.MoveNext
Wend
conn.Close
End Sub
I wrote this sub to try to copy the table name into a textbox in the same
form, by doubleclicking the list item:
Sub TablesList_Dblclick()
Dim strTbl As String
strTbl = TablesList.List(TablesList.ListIndex)
SqlBox.Text = SqlBox.Text & strTbl
End Sub
As soon as I step into this sub, I get the error. But there’s nothing to be
mismatched as implied by this error message. “Dblclick†does not occur
anywhere else in the project.
SqlBox is defined elsewhere and works fine also. It sends query text to a
database and results appear in a sheet. But currently you have to type the
entire query string. You can see the table and column names but there's no
way to pull them into the Sqlbox.
Gregg Roberts
event or procedure having the same name†in some code I’m modifying, and I
can’t figure out why. This first sub works fine; it populates a listbox with
the columns of a table in a database:
Sub TablesList_Click()
Dim conn As Connection
Dim rs As Recordset
Dim strTbl As String
ColumnsList.Clear
Set conn = New Connection
conn.ConnectionString = strConnection
strTbl = TablesList.List(TablesList.ListIndex)
conn.Open
Set rs = conn.OpenSchema(adSchemaColumns, Array(Empty, Empty, strTbl,
Empty))
While Not rs.EOF
ColumnsList.AddItem (rs("COLUMN_NAME"))
rs.MoveNext
Wend
conn.Close
End Sub
I wrote this sub to try to copy the table name into a textbox in the same
form, by doubleclicking the list item:
Sub TablesList_Dblclick()
Dim strTbl As String
strTbl = TablesList.List(TablesList.ListIndex)
SqlBox.Text = SqlBox.Text & strTbl
End Sub
As soon as I step into this sub, I get the error. But there’s nothing to be
mismatched as implied by this error message. “Dblclick†does not occur
anywhere else in the project.
SqlBox is defined elsewhere and works fine also. It sends query text to a
database and results appear in a sheet. But currently you have to type the
entire query string. You can see the table and column names but there's no
way to pull them into the Sqlbox.
Gregg Roberts