Error in Microsoft Access

C

Christophe Bauters

Dear,

I've made a form in Access but when I Click on a button there comes an
error:

The expression By clicking that you gave as adjustment for the event
property, has made the following error:

* The expression doesn't have the name of a macro, the name of a by user
definied function or an [eventprocedure] as result
* There appears an error by evaluating a function, event or macro.

My version of Access is in Dutch, so it can be that there are mistakes in
the error I wrote down here. My apologys for that. Can someone help me
please?


1. There are more buttons that give the same error, but one of the buttons
is supposed to close the form.

2. This is the code in the On_Click event of the button to close the form,
but I'm sure that it's not the code, because I made it with the wizard:
Private Sub FormulierSluiten_Click()
On Error GoTo Err_FormulierSluiten_Click


DoCmd.Close

Exit_FormulierSluiten_Click:
Exit Sub

Err_FormulierSluiten_Click:
MsgBox Err.Description
Resume Exit_FormulierSluiten_Click

End Sub

3. There isn't a macro attached to it. It's VBA-code.

Thank you, Christophe
 
6

'69 Camaro

Hi, Christophe.
The expression By clicking that you gave as adjustment for the event
property, has made the following error:

You're receiving this error message because the code in your form's module
doesn't compile. Normally, the reason for the error is given in the first
paragraph of the error message:

"The expression On Click you entered as the event property setting produced
the following error:"

.... followed by the actual error, such as "block if without end if" (caused
when the programmer forgets the "End If" in the code) or "invalid outside
procedure" (caused when the programmer tries to set a value for a module
level variable outside of any procedure block), et cetera.

Since your error message isn't telling you what the problem is, you'll need
to compile the code yourself to determine the problem. Open the form's
module in the VB Editor and select the Debug menu -> Compile <Your Database
Name> to compile the code.

You'll receive an error message indicating what the problem is. Fix
whatever the problem is, then save the changes in the module, then attempt
to compile again. Keep fixing the errors, save the changes and then compile
again until you receive no more error messages.

If there's an compilation error that you don't know how to fix, please post
back.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)


Christophe Bauters said:
Dear,

I've made a form in Access but when I Click on a button there comes an
error:

The expression By clicking that you gave as adjustment for the event
property, has made the following error:

* The expression doesn't have the name of a macro, the name of a by user
definied function or an [eventprocedure] as result
* There appears an error by evaluating a function, event or macro.

My version of Access is in Dutch, so it can be that there are mistakes in
the error I wrote down here. My apologys for that. Can someone help me
please?


1. There are more buttons that give the same error, but one of the buttons
is supposed to close the form.

2. This is the code in the On_Click event of the button to close the form,
but I'm sure that it's not the code, because I made it with the wizard:
Private Sub FormulierSluiten_Click()
On Error GoTo Err_FormulierSluiten_Click


DoCmd.Close

Exit_FormulierSluiten_Click:
Exit Sub

Err_FormulierSluiten_Click:
MsgBox Err.Description
Resume Exit_FormulierSluiten_Click

End Sub

3. There isn't a macro attached to it. It's VBA-code.

Thank you, Christophe
 
C

Christophe Bauters

Hi, '69 Camaro

I did what you said in your message, but access didn't give an error
message.

Christophe
 
6

'69 Camaro

Hi, Christophe.

From Access 2003 Help:
------------------------------------------------------------
Visual Basic for Applications (VBA) encountered a problem while attempting
to access a property or method. The problem may be one of the following:

A reference is missing.

For help restoring missing references, see the Microsoft Knowledge Base
article 283806.

An Expression is misspelled.

Check all expressions used in event properties for correct spelling.

A user-defined function is declared as a sub or as a private function in a
module.

Expressions can resolve a user-defined function only if the function is
declared as one of the following:

- A public function in a module

- A public or private function in a code module of the current form or
report

Security in Access is set to Medium or High and the Microsoft Jet 4.0 SP8
update is not installed.

A more recent verion of Jet 4.0 must be installed for Access to function
properly when security is set to Medium or High. To obtain the latest
version of Microsoft Jet, go to Windows Update.
------------------------------------------------------------

So, check the References to ensure that none of them are marked "MISSING:".
Check to ensure that there aren't any expressions misspelled in one of the
form's properties.

Macro security may not affect you if you aren't using Access 2003, so the
information above about Jet 4.0 SP8 may not apply to this error. However,
if you have Access 2K or later, then you should download and install Jet 4.0
SP8.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
 
J

Joop

Hi Christophe,



Wat je kunt doen is het volgende:



Plaats een "Onderbrekingspunt" (menu foutopsporing) aan het begin van de VBA
code door voor de kantlijn te klikken (er verschijnt een bruine dot in de
kantlijn). Nu kun je met F8 stap voor stap door de code heen lopen en exact
vinden wat je probleem veroorzaakt. Helpt dit?



Wat verder nog zou kunnen is dat de naam in de eigenschappen van de knop is
gewijzigd (tabblad overigen in de eigenschappen van de button)



Succes, Joop
 
C

Christophe Bauters

Hi Joop,

I tried what you said, but when I set an interruption point, he just gives
the error message.

The name isn't changed either.

Thank you, Christophe
 
Top