Full Version: making a text box refresh
UtterAccess Forums > Microsoft® Access > Access Forms
krabople
Hi, I hope someone can help me. I have a form with a timer on it. The form automatically runs quite a large amount of reports at specified times. I have a textbox on the form which tells you which report is going to run next and at what time.
However, the textbox does not automatically update so whatever report is due to run next when you first open the form stays in the box until you close the form, instead of updating each time a new report is run (I hope this makes sense!). I have tried "text9.requery" and also "Form_Auto_runs.Refresh" but this still doesn't seem to make it update. Any suggestions?
(sorry for the poor explanation!)
kbrewster
How about Me.Refresh?
dashiellx2000
I imagine you have a table which lists all the reports that are supposed to run. On this table do you have a time when the report is supposed to run? If so, make your text box bound to a query and only let it show reports that are after the current time. Then requery the form after each report run as the last line of code.
TH.
krabople
I tried that as well but it doesn't seem to make any difference
krabople
The text box is already bound to a query which works out when the next report will run and which report it is. After the report is run, I have put "text9.requery" (text9 is the said text box). But it doesn't seem to work.
kbrewster
What event do you have that code running on?
NoahP
Try Me.Repaint instead.
TH
Noah
krabople
Tried Me.repaint but still no luck!
The event it's on is timer.
MattJ
Me.text9.Requery should work... have you compiled your code to see if there are any errors?
-Matt
krabople
Nope, still not working. I have tried compiling and there's definitely no errors. I don't understand it.
MattJ
have you tried manually running the query the text box is based on after a report has run to verify that the query is performing correctly?
krabople
Yeah I have, there's no problem with the query, if I close the form and then re-open it it updates fine as well
MattJ
Can you post your db with just the objects needed for the form to function?
krabople
Please find attached a copy of the database
MattJ
I changed the requery command for the text boxes to simply "Me.Requery". It performed correctly, however, there is a flicker to the clock. Might want to increase your timer settings.
krabople
Brilliant that seems to work thanks. If I just put it after each report then the timer won't flash either. Thanks again.
MattJ
Glad you got it worked out!
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.