Errors compiling Access 97 modules

J_Orrell

Registered User.
Local time
Today, 01:37
Joined
May 17, 2004
Messages
55
I'm trying to compile my modules in an Access 97 database using Debug/Compile All Modules, but it's coming back with the error "Method or Data Member Not Found" wherever I've used the .OldValue property. The code works fine, so what's the issue with compiling it?

The reason I'm trying to compile it in the first place my organisation is moving from Office 97 to Office 2000 and this particular database refused to convert, and I thought if I could get the code compiled then that would be one possible variable out of the way

Thanks
 
Nope, all the references are fine. I think I've found the answer by trawling the 'net a bit. It seems that if you set a form's ControlSource property from it's OnOpen event using an SQL SELECT query, and if a control on your form is bound to a field which doesn't exist prior to you setting the ControlSource in that way, when you try to compile the code it will fall over with this error message. This is because the compiler looks at the form's Control Source in design mode and uses THAT to determine what are valid and invalid fields. Doh! I'll have to try to work round that one!
 
J_Orrell said:
It seems that if you set a form's ControlSource property from it's OnOpen event using an SQL SELECT query

Why would you want to do this? Is your structure not normalised? And why would you use SQL when you can save space by creating a stored query rather than recreate the same query over and over again every time a form is opened?
 

Users who are viewing this thread

Back
Top Bottom