Auto refresh field every 30 seconds

rockyjr

Registered User.
Local time
Today, 01:34
Joined
Mar 12, 2008
Messages
100
I guys (and gals),

I have a field on a form that brings up information from another database. The data is sometimes modified and I would need it to refresh every 30 seconds to check for new info. Is this possible?

Thanks in advance,

Luc
 
I've done this somewhere...I know I have, but can't lay my hands on it right now.

It's something to do with the OnTimer event. I think you need to put
Me.Requery (or maybe Me.YourSpecificControlName.Requery), in the OnTimer event of your form.

Then you need to set the TimerInterval of your form to whatever equals 30 seconds. I don't know what units are used but they're not seconds. Possibly tenths of seconds? Anyway, try a value like 3000 and see what happens.

I'll look again for what I did before.
 
I tried requery and refresh and it didnt work
I might doing it wrong....

I tried:
Code:
Me.Requery.txtmemo
TimerInterval = 3000
 
Tried it where? The

TimerInterval = 3000

needs to be in the Form_Load event, or entered by way of the Properties sheet, in Design View. The

Me.Requery.txtmemo

needs to be

Me.txtMemo.Requery

and needs to be in the Form_Timer event.

Also

TimerInterval = 3000

sets the interval at 3 seconds!

TimerInterval = 30000

sets it at 30 seconds.
 
I tried it and didnt work

I do see the requery being done... but it doesnt check for new info. If I click on the field itself, and then click F5 on the keyboard, it refreshs fine. Is there a way to make it automatic?
 
Last edited:
Your form's coding should have two elements ..

Code:
Private Sub Form_Open(Cancel As Integer)
        Me.TimerInterval = 30000
End Sub

Code:
Private Sub Form_Timer()
     Me.txtMemo.Requery
     Me.Refresh
End Sub

-dK
 
Last edited:
I do see the "flicker", like a refresh, but the new info is not updating!!

Is there a way I can focus on the field name , then refresh??
 
lol .. ummm .... try saving the record on the timer event and drop the Me.Refresh. Refresh updates the records of the underlying source so if the current record isn't saved - refresh doesn't do any good.

Code:
Private Sub Form_Timer()
     DoCmd.RunCommand acCmdSaveRecord
     Me.txtMemo.Requery
End Sub

-dK
 
Crap, didnt work.

Is there a way to simulate F5 on a field?
 
it works, perhaps it's the referencing to your form control or maybe as what the previous poster said about saving the records to the main table, anyway the refresh code is not the issue
 

Users who are viewing this thread

Back
Top Bottom