procedure declaration does not match description of event or procedure having the sam

liamfitz

Registered User.
Local time
Today, 05:14
Joined
May 17, 2012
Messages
240
procedure declaration does not match description of event or procedure having the same name. I'm getting this error, on Command buttons, which worked perfectly fine recently. I've not changed the Click event code, or name in any way, yet this error persists. Any ideas ?? Thanks.:banghead:
 
Does the procedure have parameters that you forgot to include??
 
Thanks for the pointer pr2-enguin. You may be on to something. I've just added a proc. for opening a word document, with params. Let me run a couple of deductive tests around this.;)
 
that seesm to have been the 'sticking point' ( bad paramter use for proc. ) That's cleared up now, but one of my command buttons is not doing anything - I've put a breakpoint right on the Click_Event firts line of code, and eevn that doesn't get triggered ?
 
Hmmm.. can you post your code? Also make sure that the button is actually linked to the event by going in design view and click the button and see if it says in the OnClick [EventProcedure]
 
Thanks for your interest pr2-eugin. I've now got the proc. working. I renamed the Command button ( by changing a couple of leters, then pasted in the code from the non-working, On_Click event ( for the same control ) this seems to have 'jogged' it into life. Thanks again. I'll need to be more vigilant when setting/using parameters, for functions in future, as that was the catalyst for these bugs.
 
Getting same error and I'm at a complete loss.
Was working up until I got cute and decided to use more descriptive names for the command buttons.

Got the error msg immediately after that and I cant make it go away.

Tried renaming the buttons, but to no avail.

Please HELPPPP!!!



CODE:

Option Compare Database
Public txtClicked As String
Private Sub ExitBtn_Click(Cancel As Integer)
Dim saveAns As Integer
saveAns = MsgBox("Exit without saving?", vbYesNo)

'If 'Save' Button IS Clicked...

If txtClicked = "Yes" Then

If IsNull(Me.BLOCK) Or IsNull(Me.LOT) Or IsNull(Me.ZONE) Or IsNull(Me.BLDG_NUM) Or IsNull(Me.STREET) Or IsNull(Me.ATERY) Or IsNull(Me.ADDED_BY) Or IsNull(Me.OIL_TYPE) Then
Cancel = True
MsgBox "Some required fields have not been completed."
End If


Else


'If 'Save' Button IS NOT Clicked...

If saveAns = vbYes Then
Me.Undo
DoCmd.Close acForm, acSaveNo
DoCmd.OpenForm "SWITCHBOARD"
Else
Cancel = True
End If
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)

Dim saveAns As Integer
saveAns = MsgBox("Exit without saving?", vbYesNo)
'If <<'Save' Button IS Clicked>> Then
If txtClicked = "Yes" Then

If IsNull(Me.BLOCK) Or IsNull(Me.LOT) Or IsNull(Me.ZONE) Or IsNull(Me.BLDG_NUM) Or IsNull(Me.STREET) Or IsNull(Me.ATERY) Or IsNull(Me.ADDED_BY) Or IsNull(Me.OIL_TYPE) Then
Cancel = True
MsgBox "Some required fields have not been completed."
End If


Else

'If <<Macro-based 'Save' Button IS NOT Clicked>> Then


If saveAns = vbYes Then
Me.Undo
DoCmd.Close acForm, acSaveNo
DoCmd.OpenForm "SWITCHBOARD"
Else
Cancel = True
End If
End If
End Sub
Private Sub SaveBtn_Click(Cancel As Integer)
If IsNull(Me.BLOCK) Or IsNull(Me.LOT) Or IsNull(Me.ZONE) Or IsNull(Me.BLDG_NUM) Or IsNull(Me.STREET) Or IsNull(Me.ATERY) Or IsNull(Me.ADDED_BY) Or IsNull(Me.OIL_TYPE) Then
Cancel = True
MsgBox "Some required fields have not been completed."

Else

DoCmd.RunCommand acCmdSaveRecord
MsgBox "Record Saved"

End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom