Link to home
Start Free TrialLog in
Avatar of wsturdev
wsturdevFlag for United States of America

asked on

Any way to trace code

I need to trace the route an execution takes through some code.

1. Is there a built-in function to record the names of all handlers that are executed (including the name of the form within which they reside)?

2. I know I can create a table, then in each handler I can record the desired information.  Is there some VBA syntax that will allow me to record the name of the form and the name of the handler without having to hard code that info in each statement?  e.g. Form.Name, CurrentHandler.Name
Avatar of LennyGray
LennyGray
Flag of United States of America image

you need to go into the code section of the function or event sub that you are interested in tracing. Right click the left of a line that you want exeution to stop at. When execution stops, invokethe immediate window and use the syntax starting with a question mark. Like if you wanted to see a variable value you would type ?sTheVariableName and then hit [Enter]. There you would see the current value of the variable. F8 advances the code line-by-line.

Look up help on debugging.

Good Luck !!!
ASKER CERTIFIED SOLUTION
Avatar of stevbe
stevbe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial