|
|
VBA code is missing referenceIf your VBA object code will just not work the way it is supposed to then you may be missing a crucial VBA reference. A good way to check for this is to see if methods and actions exist for the object. How:- 1) Open any form in design view. 2) Open the VBA code window - click on the code icon.
3) In any code module type the name of the object followed by a "."
If a list of actions and methods appears then the object exists in the VBA references. If nothing appears then the object does not exist in the VBA references and won't function. You must 'tick' the relevant reference before the object will work. Knowing which reference to tick is the critical thing - there does not appear to be any way to find out which reference is required any given object. The only clue lies in what type of object you have and the name of the Reference. Do not turn on unnecessary references or your application will suffer performance problems. To turn on a reference: 1) From the Visual Basic Windows - Click on the Tools then References...
2) The references will be shown as a list:-
Tick the required reference - unticked ones are listed alphabetically.
|