The expression On Click you entered produced the following error..

J

JB

I've got a database which manages various tasks, I have a main interface with
several sub-interfaces. Each one has a button used to close the forms and
return to the main interface. However I added a new sub-interface to and I
get an error every time I try and use:

Private Sub Exit_DVDLib_Click()
On Error GoTo Err_Exit_DVDLib_Click


DoCmd.Close

Exit_Exit_DVDLib_Click:
Exit Sub

Err_Exit_DVDLib_Click:
MsgBox Err.Description
Resume Exit_Exit_DVDLib_Click

End Sub

The error is as follows (bit of a long one!).....

The expression On Click you entered produced the following error:
A problem occured while <form name> was communicating with the OLE server or
ActiveX Control.

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.

I'm stumped! Everything seems to be spelt ok, no references are shown as
[MISSING], and i've even recreated the interface with differently named
functions etc and still I get the same thing :(
I really need to get this working and it's driving me nuts, any help
appreciated!
 
J

JB

Further to my original post it seems to be every time I use:

DoCmd.Close

But only on this form!?
 
J

JB

Ok, it gets stranger... if add a command button of any description without
any function as below....

Private Sub DVD_Click()

End Sub

I still get the error!!
Yet all existing interfaces still work fine!? I really do not understand
whats going on!
 
D

Dirk Goldgar

JB said:
Ok, it gets stranger... if add a command button of any description
without any function as below....

Private Sub DVD_Click()

End Sub

I still get the error!!
Yet all existing interfaces still work fine!? I really do not
understand whats going on!

I wonder if there's some coding error in that form's module that is
prevernting the module from compiling. Post the whole module, and maybe
it will become clear.
 

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