Refreshing a form

  • Thread starter Thread starter Keith
  • Start date Start date
K

Keith

I have a form with a button which runs a routine. I also have a field on
the form that I want to say how many times the routine has go round a
loop in the code. I have line in the loop to do this, but the field on
the form only updates after the whole thing is finished. I presume this
is due to Access being to busy to refresh the form, even though I have
put in a refresh command. How can I force the form to be updated? I
know the rest of it works fine because if I let the routine run to the
end or break out of the code the field updates.

Anybody got any ideas?
 
Try putting a Me.Repaint after you increment the loop. You may also need a
DoEvents.
 
I haven't seen your code, but I tried a similar experiment on my machine.
Using a loop that went for 1 million iterations, it appeared as though I was
duplicating your results. Then I set a breakpoint in the code and stepped
through it. My form updated properly. So my conclusion was that the computer
was simply too fast for me to see the text box change. Make sure that you
have a line in your loop that reads something like:

Me.Text1 = loop counter

then try setting a breakpoint and stepping through your code.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 

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

Similar Threads

Access Form Refresh 1
Refreshing Data Form in a Tab 1
Refresh/OnCurrent Questions 3
Refresh Subform 1
Refresh Table 3
Refresh unbound textbox 5
Refreshing a main form 1
Automatic Refresh 2

Back
Top