Was working...now producing error...

G

Guest

The following line of code was working fine before I went on holidays, now
I'm back and whenever I open the form it tells me there is a problem with
this code......why?

"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." WTF?

Me.cmdCarrier.Enabled = Nz(Me.CarrierClaim.Value, False)

cheers
 
D

Douglas J Steele

The error message is saying there's something wrong with whatever you've got
as the procedure to run on the form's Current event.

Open the form's properties, and find the On Current property on the Event
tab. What's beside it?

If it's the line of code you have posted, you can't put that as a event
procedure: it must be either the name of a macro in your database, the name
of a function in your database (preceded with an equal sign), or the text
[Event Procedure] (complete with square brackets).

If it's [Event Procedure], click on the ellipsis to the right (...), and
make sure that the procedure to which the VB Editor opens starts Private Sub
Form_Current( ). If there's anything in the parentheses, that's the problem.
 
G

Guest

It might be (and only might be) a broken or bad reference to a library. Go to
Visual Basic, click Tools, then References and make sure you have the
Microsoft Access X.X Ojbect Library (X.X is probably 11.0 for 2003). Nz() is
a function of this library.
 
G

Guest

There's nothing in the parentheses...

Private Sub Form_Current()
Me.cmdCarrier.Enabled = Nz(Me.CarrierClaim.Value, False)
End Sub

There is [Event Procedure] etc etc I know all that stuff, I just don't see
why something should work two weeks ago and not now (nothing changed).

Douglas J Steele said:
The error message is saying there's something wrong with whatever you've got
as the procedure to run on the form's Current event.

Open the form's properties, and find the On Current property on the Event
tab. What's beside it?

If it's the line of code you have posted, you can't put that as a event
procedure: it must be either the name of a macro in your database, the name
of a function in your database (preceded with an equal sign), or the text
[Event Procedure] (complete with square brackets).

If it's [Event Procedure], click on the ellipsis to the right (...), and
make sure that the procedure to which the VB Editor opens starts Private Sub
Form_Current( ). If there's anything in the parentheses, that's the problem.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


albycindy said:
The following line of code was working fine before I went on holidays, now
I'm back and whenever I open the form it tells me there is a problem with
this code......why?

"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." WTF?

Me.cmdCarrier.Enabled = Nz(Me.CarrierClaim.Value, False)

cheers
 
G

Guest

Checked that too. (Object Library 9.0, only access2000....)

Anyhoo....! Somehow it seems to be working now...which is strange, because I
have changed nothing!! Have only been familiarising myself with what I last
did a few weeks back...this computer is weird!!!
 
G

Guest

Gosh, sounds like normal Access! :))

Glad it's now working, but I know it's frustrating 'cause you don't know
when it'll do it next.

Kerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top