Call Module From VBA

LB79

Registered User.
Local time
Today, 07:01
Joined
Oct 26, 2007
Messages
505
Hello,

I'm not sure im my search is working – I thought this might have been covered somewhere but I cant find it.

I have a control on a form that I want to use to activate a module.
The module is called “Sub CstAll()” but I cant figure out how to call the function.

Can anyone assist.

Thanks
 
You don't call the module, you call the function. You should just be able to call it:

Code:
If YouWantToRunTheFunction Then
  FunctionName
End If
 
Sorry I meant the function.
I tried to call my fuction but it says Compile Error.
My function is called CSTAll, which I put in my form code.
Have i missed something out?

Thanks
 
Hi,

Are you calling it like this:

Call CSTAll

Or Like this:

CSTAll

If it's the first example then it should work, if it's the second example then you need to change to look like the first example.

FAB

John
 
The Call statement is optional. If used, the arguments must be in parentheses.
 
Thanks - it appears that the "Call" was needed...
 

Users who are viewing this thread

Back
Top Bottom