Automatic Requery

D

DavidS

I have a chart on a form that is based upon a query. It shows the number of
orders processed during the current day.

Is it possible to have this form periodically requery itself or am I doing
this the wrong way?
 
O

Ofer

On the OnTimer Property of the form you can write the code
Me.Requery
On the TimerInterval Property you can specify the time period for the
OnTimer to run

This form need to have the focus.
 
D

DavidS

Thanks for your help... but it's not working for me.

I checked the documentation for the ontimer and timerinterval properties and
I found a demonstration clock and that works fine... it updates every second.

Unfortunately, the form does not requery... at least the charts and dlookup
procedures are not updating.

any ideas what I am doing wrong?
 
O

Ofer

First put a code break on the code you have, (while the cursor is on the
requery line press F9), then run the form to see if the timer works, it
should stop there.
If it does and more code to it

me.requery
me.[The field with the dlookup name].requery
and the same for the chart
 
D

DavidS

It worked!

Private Sub Form_Timer()
Clock.Caption = Time ' Update time display.
Me.Graph2.Requery
Me.Graph3.Requery
Me.Text5.Requery
Me.Text7.Requery

End Sub

this works fine! I was surprised that I had to name each control to get it
to requery.
Thanks for the help!
 
Top