If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Strange OnCurrent error
So, I added an OnDirty Event to a control on my SalesOrder form. Now, all of
a sudden, I'm getting an error regarding the forms OnCurrent Event, which was working fine up until 5 minutes ago. The forms OnCurrent Event is an [EventProcedure]. I've changed the name of the procedure, used the ... button to create a fresh one, copied code into it, deleted the old one, and it still gets the error. I've also made it so that procedure only has a msgbox in case there was an error with the code, to no avail. Any ideas what can cause this? |
#2
|
|||
|
|||
Strange OnCurrent error
It might help to know what the error message says...
"markmarko" wrote in message ... So, I added an OnDirty Event to a control on my SalesOrder form. Now, all of a sudden, I'm getting an error regarding the forms OnCurrent Event, which was working fine up until 5 minutes ago. The forms OnCurrent Event is an [EventProcedure]. I've changed the name of the procedure, used the ... button to create a fresh one, copied code into it, deleted the old one, and it still gets the error. I've also made it so that procedure only has a msgbox in case there was an error with the code, to no avail. Any ideas what can cause this? |
#3
|
|||
|
|||
Strange OnCurrent error
Yes, sorry. I just thought of that myself.
Here's the error message: "The expression On Current you entered as the event property setting produced the following error: Procedure declaration does not match description of event or procedure having the same name. * The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure] * There may have been an error evaluating the function, event, or macro. This error occurs when an event has failed to run because Microsoft Office Access cannot evaluate the location of the logic for the event. For example, if the OnOpen property of a form is set to =[Field], this error occurs because Access expects a macro or event name to run when the event is fired." |
#4
|
|||
|
|||
Strange OnCurrent error
"markmarko" wrote in message
... Yes, sorry. I just thought of that myself. Here's the error message: "The expression On Current you entered as the event property setting produced the following error: Procedure declaration does not match description of event or procedure having the same name. * The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure] * There may have been an error evaluating the function, event, or macro. This error occurs when an event has failed to run because Microsoft Office Access cannot evaluate the location of the logic for the event. For example, if the OnOpen property of a form is set to =[Field], this error occurs because Access expects a macro or event name to run when the event is fired." I suggest you post the code you have for both the Curret event and the Dirty event. If it bothers you, posting just the Sub header lines will probably be enough. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#5
|
|||
|
|||
Strange OnCurrent error
The On Current code had all been put into comments (behind single quote
mark), and just msgbox ("On Current") remained. The dirty had a similar msgbox for debugging, with no other code. |
#6
|
|||
|
|||
Strange OnCurrent error
"markmarko" wrote in message
... The On Current code had all been put into comments (behind single quote mark), and just msgbox ("On Current") remained. The dirty had a similar msgbox for debugging, with no other code. That's not the information we need. The error message says the procedure header -- the "Private Sub Form_Current" or "Private Sub Form_Dirty" line -- is wrong. If the error message is correct, those are the lines we need to see. It doesn't matter what's between the "Sub" and "End Sub" lines; it's the "Sub" lines themselves that are i question. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
#7
|
|||
|
|||
Strange OnCurrent error
Private Sub Form_Current()
End Sub -------------- Private Sub AssociatedCustAcct_Junction_Dirty(Cancel As Integer) End Sub -------------- The sub lines are the ones that were auto-generated by access when I clicked the "..." button on the event. |
#8
|
|||
|
|||
Strange OnCurrent error
"markmarko" wrote in message
news Private Sub Form_Current() End Sub -------------- Private Sub AssociatedCustAcct_Junction_Dirty(Cancel As Integer) End Sub -------------- The sub lines are the ones that were auto-generated by access when I clicked the "..." button on the event. I don't see anything wrong with those. I wonder if your database has been corrupted, or if maybe something else in the code module is causing a compile error that is being misreported. Before chasing the corruption possibility, check to make sure you don't have duplicate event procedures -- two Form_Current procs, or two AssociatedCustAcct_Junction_Dirty() procedures. -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) |
Thread Tools | |
Display Modes | |
|
|