Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default "Procedure declaration does not match description" error, _dblclic

Im getting the error Procedure declaration does not match description of
event or procedure having the same name in some code Im modifying, and I
cant 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 theres 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default "Procedure declaration does not match description" error, _dblclic

Try

Sub TablesList_DblClick(Cancel As ReturnBoolean)

instead of

Sub TablesList_Dblclick()

--
Regards,
Tom Ogilvy

"Gregg Roberts" wrote:

Im getting the error Procedure declaration does not match description of
event or procedure having the same name in some code Im modifying, and I
cant 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 theres 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default "Procedure declaration does not match description" error, _dbl

Sure enough, that fixed it! Thanks!

Why do you suppose the parameter is required for DblClick but not for Click?

Gregg Roberts

"Tom Ogilvy" wrote:

Try

Sub TablesList_DblClick(Cancel As ReturnBoolean)

instead of

Sub TablesList_Dblclick()


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default "Procedure declaration does not match description" error, _dbl

the cancel argument allows you to cancel the normal behavior for the
doubleclick.

It is useful in cells, so you don't go into edit mode (the normal behavior)
after you code performs some action in response to the double click. (of
course there is it properly named beforedoubleclick).

I can't say why it is designed that way, but whenever programming events,
you should use the dropdown at the top to put in the event declaration rather
than trying to type it is. This will insure you have the correct argument
list.

--
Regards,
Tom Ogilvy


"Gregg Roberts" wrote:

Sure enough, that fixed it! Thanks!

Why do you suppose the parameter is required for DblClick but not for Click?

Gregg Roberts

"Tom Ogilvy" wrote:

Try

Sub TablesList_DblClick(Cancel As ReturnBoolean)

instead of

Sub TablesList_Dblclick()


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default "Procedure declaration does not match description" error, _dblclic

You cannot make up your own declarations for Excel's events. You MUST use
the declaration used by Excel.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

"Gregg Roberts" wrote in message
...
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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default "Procedure declaration does not match description" error, _dbl

Thanks, guys!
--
Gregg Roberts

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default "Procedure declaration does not match description" error, _dbl

BTW, the VBA help example in my version is incorrect on this. It has two
arguments when there's only Cancel. :-(
--
Gregg Roberts

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countif declaration problem with ""word"" mpot4[_2_] Excel Programming 2 October 11th 05 03:27 AM
function "compile error msg: procedure too large" RASHESH Excel Programming 4 May 13th 05 04:48 AM
Programmatically switch off "Variable declaration reqiured" in VBE? Alan Excel Programming 6 December 15th 04 10:31 AM
bizarre "invalid procedure call" error PatFinegan[_14_] Excel Programming 11 July 13th 04 07:56 PM
the "Procedure too large" error abxy[_57_] Excel Programming 1 April 22nd 04 03:16 AM


All times are GMT +1. The time now is 09:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"