A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Strange OnCurrent error



 
 
Thread Tools Display Modes
  #1  
Old December 28th, 2007, 04:55 PM posted to microsoft.public.access.forms
markmarko
external usenet poster
 
Posts: 142
Default 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  
Old December 28th, 2007, 05:03 PM posted to microsoft.public.access.forms
Baz[_3_]
external usenet poster
 
Posts: 96
Default 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  
Old December 28th, 2007, 05:20 PM posted to microsoft.public.access.forms
markmarko
external usenet poster
 
Posts: 142
Default 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  
Old December 28th, 2007, 05:27 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default 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  
Old December 28th, 2007, 05:41 PM posted to microsoft.public.access.forms
markmarko
external usenet poster
 
Posts: 142
Default 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  
Old December 28th, 2007, 05:54 PM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default 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  
Old December 28th, 2007, 08:54 PM posted to microsoft.public.access.forms
markmarko
external usenet poster
 
Posts: 142
Default 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  
Old December 29th, 2007, 07:46 AM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:55 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.