Using Quick Watch
Provided by: FMS Development Team
What is the Quick Watch?
The Quick Watch allows you to monitor the value of any
variable, property, object, or expression as your code executes.
Additionally, the Quick Watch allows you to specify a condition to allow the
execution of the code to enter a break mode. This break mode will allow you
to examine the code and/or values.
What are the Context Types?
The context types allow you to specify the range for which
to monitor the variable, property, object or expression. For example, if you
have a global variable that you need to monitor, you can narrow your focus
to a specific Module and/or Procedure to see if the value changes or remains
||Select “(All Procedures)” or specify a specific procedure to
monitor the variable or expression.
||Select “(All Modules)” or specify a specific module to monitor
the variable or expression.
What are the Watch Types?
There are 3 types of Watch expressions:
||Monitor the variable, property, object or expression as the code
|Break When Value Is True
||The code execution halts when the expression entered evaluates
|Break When Value Changes
||The code execution halts when the expression entered changes its
Why is Quick Watch Helpful?
Suppose you have a variable that changes values at many
locations in your code. What should you do if the value you are expecting is
not the value the variable contains? Instead of littering your code with
many message boxes or break points to watch the variable, the Quick Watch
monitor can perform this action for you.
For example, you define a Boolean variable ‘fIsOK’. A True
value will allow the application to process the customer’s order. However,
the value never gets set to True. To see where the value gets set to False,
you can set the Quick Watch as such:
Run your application. When the expression fisOK equals False, your
application will halt at the line of code. From this point, you can evaluate
your code to resolve the problem.
How to Open Quick Watch?
The Access help file provides step-by-step instructions on how to open
the Quick Watch window. Search for "Debug your Visual Basic code".
The subtopic is called "Add, modify, or delete a watch expression in the
Watch window of the Microsoft Visual Basic Editor".
Return to the tips page