procedure declaration

  • Thread starter Thread starter David#
  • Start date Start date
D

David#

Error text - "Procedure declaration does not match
description of the event or procedure having the same
name." I have a button on a form used to open another
form, filtered to include only records with matching
ClientNumber fields. I used the Command Button wizard
feature to create this, linking the field names in each
form (ClientNumber) Also tried it using a macro, but
continue to get the same error. I've done this a
gazillion times, but today, it won't go.
What am i missing??
 
David# said:
Error text - "Procedure declaration does not match
description of the event or procedure having the same
name." I have a button on a form used to open another
form, filtered to include only records with matching
ClientNumber fields. I used the Command Button wizard
feature to create this, linking the field names in each
form (ClientNumber) Also tried it using a macro, but
continue to get the same error. I've done this a
gazillion times, but today, it won't go.
What am i missing??


I don't know what you're missing, if anything ;-)

But, check to make sure the event's Sub statement has the
correct syntax and arguments. (Note: this will be created
automatically if you click the [...] button in the right
margin of OnClick on the button's property sheet.)
 
The following is the code pasted from the form


Private Sub cmdOpenAssists_Click()
On Error GoTo Err_CcmdOpenAssists_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAssists"

stLinkCriteria = "[ClientNumber]=" & "'" & Me!
[ClientNumber] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenAssists_Click:
Exit Sub

Err_cmdOpenAssists_Click:
MsgBox Err.Description
Resume Exit_cmdOpenAssists_Click

End Sub
-----Original Message-----
David# said:
Error text - "Procedure declaration does not match
description of the event or procedure having the same
name." I have a button on a form used to open another
form, filtered to include only records with matching
ClientNumber fields. I used the Command Button wizard
feature to create this, linking the field names in each
form (ClientNumber) Also tried it using a macro, but
continue to get the same error. I've done this a
gazillion times, but today, it won't go.
What am i missing??


I don't know what you're missing, if anything ;-)

But, check to make sure the event's Sub statement has the
correct syntax and arguments. (Note: this will be created
automatically if you click the [...] button in the right
margin of OnClick on the button's property sheet.)
 
David,

On Error GoTo Err_CcmdOpenAssists_Click

You have an extra "C" in the name.

Kelvin

David said:
The following is the code pasted from the form


Private Sub cmdOpenAssists_Click()
On Error GoTo Err_CcmdOpenAssists_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAssists"

stLinkCriteria = "[ClientNumber]=" & "'" & Me!
[ClientNumber] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenAssists_Click:
Exit Sub

Err_cmdOpenAssists_Click:
MsgBox Err.Description
Resume Exit_cmdOpenAssists_Click

End Sub
-----Original Message-----
David# said:
Error text - "Procedure declaration does not match
description of the event or procedure having the same
name." I have a button on a form used to open another
form, filtered to include only records with matching
ClientNumber fields. I used the Command Button wizard
feature to create this, linking the field names in each
form (ClientNumber) Also tried it using a macro, but
continue to get the same error. I've done this a
gazillion times, but today, it won't go.
What am i missing??


I don't know what you're missing, if anything ;-)

But, check to make sure the event's Sub statement has the
correct syntax and arguments. (Note: this will be created
automatically if you click the [...] button in the right
margin of OnClick on the button's property sheet.)
 
That looks good to me. Are you sure this is the code that's
causing the error? Did you Compile your project to make
sure there are no compile errors?

If all else fails, I might begin to suspect corruption. See
http://www.granite.ab.ca/access/corruptmdbs.htm
for a discussion of this situation.
--
Marsh
MVP [MS Access]


The following is the code pasted from the form

Private Sub cmdOpenAssists_Click()
On Error GoTo Err_CcmdOpenAssists_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAssists"

stLinkCriteria = "[ClientNumber]=" & "'" & Me!
[ClientNumber] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenAssists_Click:
Exit Sub

Err_cmdOpenAssists_Click:
MsgBox Err.Description
Resume Exit_cmdOpenAssists_Click

End Sub
-----Original Message-----
 
Good eyes Kelvin! I wouldn't have spotted that in a million
years.

That's the kind of thing I let the compiler find for me.
--
Marsh
MVP [MS Access]

David,

On Error GoTo Err_CcmdOpenAssists_Click

You have an extra "C" in the name.

Kelvin

David said:
The following is the code pasted from the form


Private Sub cmdOpenAssists_Click()
On Error GoTo Err_CcmdOpenAssists_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAssists"

stLinkCriteria = "[ClientNumber]=" & "'" & Me!
[ClientNumber] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenAssists_Click:
Exit Sub

Err_cmdOpenAssists_Click:
MsgBox Err.Description
Resume Exit_cmdOpenAssists_Click

End Sub
-----Original Message-----
David# wrote:

Error text - "Procedure declaration does not match
description of the event or procedure having the same
name." I have a button on a form used to open another
form, filtered to include only records with matching
ClientNumber fields. I used the Command Button wizard
feature to create this, linking the field names in each
form (ClientNumber) Also tried it using a macro, but
continue to get the same error. I've done this a
gazillion times, but today, it won't go.
What am i missing??


I don't know what you're missing, if anything ;-)

But, check to make sure the event's Sub statement has the
correct syntax and arguments. (Note: this will be created
automatically if you click the [...] button in the right
margin of OnClick on the button's property sheet.)
 
The error message was a help. It said the procedure didn't match what was
being called. Otherwise, I probably wouldn't have seen it either.

Marshall Barton said:
Good eyes Kelvin! I wouldn't have spotted that in a million
years.

That's the kind of thing I let the compiler find for me.
--
Marsh
MVP [MS Access]

David,

On Error GoTo Err_CcmdOpenAssists_Click

You have an extra "C" in the name.

Kelvin

David said:
The following is the code pasted from the form


Private Sub cmdOpenAssists_Click()
On Error GoTo Err_CcmdOpenAssists_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAssists"

stLinkCriteria = "[ClientNumber]=" & "'" & Me!
[ClientNumber] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdOpenAssists_Click:
Exit Sub

Err_cmdOpenAssists_Click:
MsgBox Err.Description
Resume Exit_cmdOpenAssists_Click

End Sub
-----Original Message-----
David# wrote:

Error text - "Procedure declaration does not match
description of the event or procedure having the same
name." I have a button on a form used to open another
form, filtered to include only records with matching
ClientNumber fields. I used the Command Button wizard
feature to create this, linking the field names in each
form (ClientNumber) Also tried it using a macro, but
continue to get the same error. I've done this a
gazillion times, but today, it won't go.
What am i missing??


I don't know what you're missing, if anything ;-)

But, check to make sure the event's Sub statement has the
correct syntax and arguments. (Note: this will be created
automatically if you click the [...] button in the right
margin of OnClick on the button's property sheet.)
 
Back
Top