vba Newbie Question 
Author Message
 vba Newbie Question

I have a button on a form, which when clicked runs some code.  If an error
occurs then the error handling is run.  All of this works fine, but I want
to run some code in a module.

The module has been saved as Errorlog and the name of the Function is
LogError.  I have tried putting the line of code LogError() but get a
compile error.

Can anyone tell me the correct line of code.

TIA
Andy



Sat, 27 Mar 2004 03:28:54 GMT  
 vba Newbie Question
It is rather hard to find the Compile Error without seeing the code!

Please post the code for the LogError() function and the partial code where
you call the LogError() function.

HTH
Van T. Dinh


Quote:
> I have a button on a form, which when clicked runs some code.  If an error
> occurs then the error handling is run.  All of this works fine, but I want
> to run some code in a module.

> The module has been saved as Errorlog and the name of the Function is
> LogError.  I have tried putting the line of code LogError() but get a
> compile error.

> Can anyone tell me the correct line of code.

> TIA
> Andy



Sat, 27 Mar 2004 13:19:45 GMT  
 vba Newbie Question
Andy,

Make sure the LogError() sub is declared as Public.

- Graham


Quote:
> I have a button on a form, which when clicked runs some code.  If an error
> occurs then the error handling is run.  All of this works fine, but I want
> to run some code in a module.

> The module has been saved as Errorlog and the name of the Function is
> LogError.  I have tried putting the line of code LogError() but get a
> compile error.

> Can anyone tell me the correct line of code.

> TIA
> Andy



Sat, 27 Mar 2004 14:09:37 GMT  
 vba Newbie Question
If you include the parentheses after a procedure name in a call to that
procedure, you need to precede it with the keyword 'Call'. Either of these
should work:

'No parentheses.
LogError

'Call and parentheses.
Call LogError()

--
Brendan Reynolds


Quote:
> I have a button on a form, which when clicked runs some code.  If an error
> occurs then the error handling is run.  All of this works fine, but I want
> to run some code in a module.

> The module has been saved as Errorlog and the name of the Function is
> LogError.  I have tried putting the line of code LogError() but get a
> compile error.

> Can anyone tell me the correct line of code.

> TIA
> Andy



Sat, 27 Mar 2004 17:40:19 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Access97 VBA newbie question

2. VBA newbie question

3. Newbie question... add-ins and VBA

4. Newbie VBA question

5. newbie question - word vba

6. Newbie Access97 VBA question

7. VBA question from newbie (Please Help)

8. newbie question - Jet VBA failed to intialize

9. Newbie question about VB5, VBA and EXCEL97

10. NEWBIE Question on Excel/VBA

11. Newbie Question: How to connect from Access2k(VBA) to MSSQL Server

12. Newbie Access 97 / VBA question(s)

 

 
Powered by phpBB® Forum Software