Debugging Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to use debug that will allow me to trace the flow of a form
from beginning to end? I have a form that has a 'look-up box', a sub-form, a
button to print a report (which is an application form with the data from the
form that 'calls ' it), and I would like to trace the flow from procedure to
procedure or module to module or whatever its called. It seems that the debug
only allows me to follow the flow through a procedure/module, but won't jump
go to wherever it goes after the end sub is reached. Is there a way to follow
the complete flow of a form from form to form or form to report? The reason I
need to do this is that the application form that prints from the button on
the application entry screen, always contains the data from the 1st record.
The 'look-up box' finds the right record and displays the right data on the
application form screen, but whenever I click the 'print button' it always
has the first record data. I thought if I could follow the flow from the
beginning and watch the appropriate variable I might could figure out why and
fix it, but then again I might not...still learning the VB syntax. Thanks for
any help anyone can give me.

Randy M
 
Randy

If you place a breakpoint in your code at the "top" of the flow (?FormLoad,
?FormOpen), I believe you can step through each line beneath that point.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
 
Thanks Jeff for replying, but that's one of the problems I'm also having, I
don't know how to get to the 'top' of the flow. I've tried to display the
code window for the main form, but I can't seem to get to the 'top'. If you
could point me to the 'top' of the form/flow, I would appreciate it. And,
thanks again for replying.

Randy M
 
Randy

It would depend on what code you have accompanying the main form. You may
have code that fires on Form_Open, Form_Load, Form_Current, Form_Activate,
....

I don't recall, off the top, which of these fires first. If you are only
using one of them, add a breakpoint in on it. The "top" is more a concept
than a physical location.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Jeff,
I appreciate you're taking the time to help me out and I hate to seem like
an idiot, although working thru this makes me fill like one at times. I have
looked for some kind of Form_xxxx, but haven't found one in any of the VB
code that I've been able to view in the VBE window. I know it's got to be out
there, but I can't get to it. I was a programmer for almost 10 years using
COBOL, but then was out of the loop so to speak for about the next 8 years
due to playing music for a living. That didn't work out so now I'm back in
computers and I'm a little out of the way things are done now. I understand
the basic concept of VB because I also did some programming in C, but I'm
just kinda lost as to how to debug these forms and such because the logic
flow is a bit different than it was in COBOL. That was pretty easy to follow
and to debug, but VB is something else to me at the present time. I'm hoping
the 'light bulb' will go on one day soon. Thanks again for your help.

Randy M
 
Open the form in design mode. Click on the Properties toolbar button.

Run down the list of properties until you get to the "OnXXXX" events (or use
the tabs in the Property window to filter by Events). If you don't have any
[Event Procedure] showing, your form doesn't have any code.

If it does, position your cursor just to the right of the 'box', and click
on the "..." to open the code.

Or, go to the Code Modules tab in the database window and open a code module
(create a new one if your app doesn't have any). On the left hand side,
there should be a list of all of the objects that have code behind them.
Can you find your form(s) there?

Regards

Jeff Boyce
<Office/Access MVP>
 
Jeff,
Thanks for the help. I've found the form, but there's not any code there
like what you were stating. There's a global module that has that in it tho,
so I guess that's where that is. I just can't seem to get my mind around
what's happening here. I'm not fluent enough with the syntax yet to
understand how to do what I want to do and the logic flow in VB is not
'natural' to me yet. Like I said, I was a COBOL programmer and this is very
different than when I was programming. I'll get it eventually, but right now
I feel like I'm wandering around in a maze and can't find my way home. I'll
think I've turned the corner, but then there's another wall and I'm stumped
again. Kinda frustrating, but I'm a stubborn kinda guy, so I'll keep
wandering around until it becomes clear. Thanks again for taking time to out
to help a lost soul wandering in the depths of VB. I appreciate it.

Randy M.

Jeff Boyce said:
Open the form in design mode. Click on the Properties toolbar button.

Run down the list of properties until you get to the "OnXXXX" events (or use
the tabs in the Property window to filter by Events). If you don't have any
[Event Procedure] showing, your form doesn't have any code.

If it does, position your cursor just to the right of the 'box', and click
on the "..." to open the code.

Or, go to the Code Modules tab in the database window and open a code module
(create a new one if your app doesn't have any). On the left hand side,
there should be a list of all of the objects that have code behind them.
Can you find your form(s) there?

Regards

Jeff Boyce
<Office/Access MVP>

WCDoan said:
Jeff,
I appreciate you're taking the time to help me out and I hate to seem
like
an idiot, although working thru this makes me fill like one at times. I
have
looked for some kind of Form_xxxx, but haven't found one in any of the VB
code that I've been able to view in the VBE window. I know it's got to be
out
there, but I can't get to it. I was a programmer for almost 10 years using
COBOL, but then was out of the loop so to speak for about the next 8 years
due to playing music for a living. That didn't work out so now I'm back in
computers and I'm a little out of the way things are done now. I
understand
the basic concept of VB because I also did some programming in C, but I'm
just kinda lost as to how to debug these forms and such because the logic
flow is a bit different than it was in COBOL. That was pretty easy to
follow
and to debug, but VB is something else to me at the present time. I'm
hoping
the 'light bulb' will go on one day soon. Thanks again for your help.

Randy M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top