code only works with a breakpoint

A

Alatoruk

I have some code on a form. it calculates various costs to array variables,
then writes these variables to a load of labels on the form. It was working
fine, but I need to run the same code from other forms so have been putting
it all into functions within a new module.

now here is the rub. I click the button to run the code and all my vaiables
appear on the form as 0s

hmmm I thought, so I put a breakpoint in at the begining and stepped through
the code. everything was correct and the labels now had the proper datra in
them.

took the breakpoint out, ran the code and all 0s again

put the breakpoint in, ran the code, pressed run once the breakpoint appeared
and all the labls have the correct data in them. but without the breakpoint
I get 0s

HELP!!!!
 
T

Terry

Hi,

Try a DoEvents after you have updated the labels contents. This allows
Access to update the screen.

Regards
 
A

Alatoruk

Terry

for it to be displaying 0s it must be refreshing. The labels are blank,
contain " " until the code writes the number into them.
Hi,

Try a DoEvents after you have updated the labels contents. This allows
Access to update the screen.

Regards
I have some code on a form. it calculates various costs to array
variables,
[quoted text clipped - 23 lines]
 
T

Terry

There used to be an issue with forms with Popup and Modal set to Yes not
updating from code external to themseves. I have had the same problem on the
odd occassion but the solutions were nothing generic and required a bit of
tinkering, sometimes even placing the code back within the form module. I
have used a class before and bound the calling form to the class then any
reference to the calling form would be something like
frm.MyLabel.Caption="xyz".

regards

Alatoruk said:
Terry

for it to be displaying 0s it must be refreshing. The labels are blank,
contain " " until the code writes the number into them.
Hi,

Try a DoEvents after you have updated the labels contents. This allows
Access to update the screen.

Regards
I have some code on a form. it calculates various costs to array
variables,
[quoted text clipped - 23 lines]
 

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

Top