U aplikaciji, na formi se nalazi dugme čiji je onclick property postavljen na docmd.SendObject ... , dakle hoću da mi se klikom na to dugme šalje email sa reportom. Sve to lepo radi na mašini na kojoj je Office 2000, međutim kad sam to isto probao sa mašine na kojoj je office 2003, javio mi je grešku sledeće sadržine:
The expression OnClick you entered as the event property setting produced a following error: A problem occured while Microsoft Office Access 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.
Izvinjavam se na ovako dugom quote-u, ali morao sam da bi situacija bila jasnija.
E sad, kada posetim Microsoft Knowledge Base, article no. 283806 (http://support.microsoft.com/default.aspx?scid=kb;EN-US;283806), on mi kaže da problem leži u pogrešnim referencama. Meni tu ništa nije jasno, zato što kad uđem u VBA editor pa idem Tools->References, imam apsolutno iste instalirane biblioteke na oba kompjutera, i to ovim redom:
-Visual Basic for Applications
-Microsoft Acces 10.0 (11.0) object library
-OLE automation
-Microsoft ActiveX Data objects 2.1 Library
Dakle, nije problem u referencama, a u ovim drugim stvarima koje Help center navodi kao razlog nije problem jer sam proverio. Što je još najžešće, kad napravim Macro, i kao akciju stavim SendObject sa potrebnim podacima, onda radi kako treba! Pa šta onda može da bude u pitanju? Gremlini or what?
Pozdrav! Izludeću od ovog Accessa!
Bolje 100 godina biti milioner nego nedelju dana siromašak
(c) Alan ford
(c) Alan ford