Requery vs Refresh

S

Stephen

Haw can I Requery or Refresh a form every 10 minutes?

Whats the major difference between requery and refresh?

Thanks
 
D

Dirk Goldgar

Stephen said:
Haw can I Requery or Refresh a form every 10 minutes?

Whats the major difference between requery and refresh?

Thanks

Requery runs the form's recordsource query all over again, so that
records that may not have existed or met the query criteria before will
now appear, and records that have been deleted or no longer meet the
criteria will disappear. Refresh fetches fresh and potentially updated
data for all the records that are currently displayed on the form, but
does not go out to get new records or drop records from the display.
Both methods force a save of the form's current record, if it's "dirty",
before fetching fresh data.

To refresh or requery every 10 minutes, you could set the form's
TimerInterval to 600000 and add an event procedure for the form's Timer
event along the lines of

Private Sub Form_Timer()

Me.Requery ' or Me.Refresh

End Sub

Bear in mind that running the Requery method will reposition the form's
current record at the first record in the new query results.
 

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