Requery vs. Refresh

S

Steve S

Some time ago (3-4 years) I remember discussions about the performance issues
of Requery vs Refresh. I know that 'RunCommand acCmdRefresh' superceeded
(replaced) DoMenuItem, 5...' in the late 90's. Supposedly ( as my memory
serves) Refresh was better for performance than Requery because it just
posted back the 'old' view of a list box or dropdown box rather than
rerunning the underlying query.

From what I am reading in Discussion Groups recently the replacement for
DoMenuItem, 5... is Me.objectName.Requery. What happened to Refresh. It is
not even available as an option for 'Me.ObjectName' but is still available as
'RunCommand acCmdRefresh' What about performance issues? Has hardware and
software improvements nade this a moot point?

I am running A2000 but getting to update to 2007. Am I going to have
problems with performance in dbs still using the esoteric (outdated and
possibly un-supported)code?
 
M

Marshall Barton

Steve said:
Some time ago (3-4 years) I remember discussions about the performance issues
of Requery vs Refresh. I know that 'RunCommand acCmdRefresh' superceeded
(replaced) DoMenuItem, 5...' in the late 90's. Supposedly ( as my memory
serves) Refresh was better for performance than Requery because it just
posted back the 'old' view of a list box or dropdown box rather than
rerunning the underlying query.

From what I am reading in Discussion Groups recently the replacement for
DoMenuItem, 5... is Me.objectName.Requery. What happened to Refresh. It is
not even available as an option for 'Me.ObjectName' but is still available as
'RunCommand acCmdRefresh' What about performance issues? Has hardware and
software improvements nade this a moot point?

I am running A2000 but getting to update to 2007. Am I going to have
problems with performance in dbs still using the esoteric (outdated and
possibly un-supported)code?


Requery and Refresh are quite different. Requery, as you
said, reloads a form's record source taking into account all
changes (new, deleted, updated) to the records in the table.
Refresh only picks up updated records that were modified in
your form/processes or by users on other systems. Both
methods will save any updates to the form's current current
record.

Individual controls do not have a Refresh method, so that
part of your question is not valid. The RunCommand and
DoMenuItem methods only operate on the "active" form.
Neither of these is totally reliable because the active form
may not always be what you think it is. It is always best
to use a method the allows you to specify the object that
you want to operate on

You have to use the Requery method for list and combo boxes,
which is more efficient than requerying the entire form.
 
D

David W. Fenton

You have to use the Requery method for list and combo boxes,
which is more efficient than requerying the entire form.

Also, requerying the form does *not* requery list and combo boxes --
it requeries only the form's underlying recordsource.
 

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