Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using functions in stead of [Event Procedure]

Status
Not open for further replies.

KeesHazen

Programmer
Dec 10, 2000
7
NL
For the past 8 years I have succesfully used functions in event handlers. Programs that always worked allright are now causing problems when converted to Access 2002 on Windows XP.
Instead of [Event Procedure] the function is entered directly in the property field, for instance: On Got Focus . . . . =GeneralOnFocusHandler()
The function "GeneralOnFocusHandler" is contained in a reference to a mde-file.
I have done some work to solve this problem but the only solution (so far) is to create an [Event Procedure] sub for all used controls, like this
Private Sub MyControl_GotFocus()
GeneralOnFocusHandler()
End Function
Can somebody tell what was changed, what causes this behaviour ?

Please HELP !
 
My only suggestion is to check your reference list and remove missing reference

To remove the missing reference, follow these steps:
1. Open your database.
2. Press ALT+F11 to open the Visual Basic Editor.
3. On the Tools menu, click References.
4. Click to clear the check box for the type library or object library marked as MISSING: <referencename>.

Other than this, let me think a little bit more. . .uh!!!
 
IF the code works in the GotFocus routine, then your reference to the GeneralFocus should be okay. You can always try calling a shell routine located within that database (the one with the form), which in turns calls the GeneralFocus.
 
Hi HomeAlone, We have to think a bit more.
There is no missing link in the references screen.

Hi JigJag, I could write a handler in a separate module, however.
The mde file contains more or less than 50 functions. I dont want to recreate this module every time a function changes. (and redistribute it to several applications everytime)
This mde-file is continuously in development and functions can get an extra parameter.

I would like to know what changes microsoft made in the acc2002 version. The latest tests show that it does work in some acc2002/winxp installations. May be it is some setting that interferes with the =function() property.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top