Recalc or requery?

F

Frank Martin

I wonder what the difference between these two are?
Sometimes one works and sometimes the other.

When I am testing a form with combos I check the requery/recalc by pressing
the F9 button and then try to resolve this back to code with, eg, Me.Requery
or Me.Recalc or Combo(x).Requery etc.

I get inconsistant results and sometimes we are reduced to pressing the F9
key to update a Combo rowsource query!

Is there some definitive solution?

Please help, Frank who has Access2000
 
B

Bob Howard

The Requery method tells Access to go and re-fetch the data underlying the
query since something may have changed since it was last queried (or form
opened).
 
D

Dirk Goldgar

Frank Martin said:
I wonder what the difference between these two are?
Sometimes one works and sometimes the other.

When I am testing a form with combos I check the requery/recalc by
pressing the F9 button and then try to resolve this back to code
with, eg, Me.Requery or Me.Recalc or Combo(x).Requery etc.

I get inconsistant results and sometimes we are reduced to pressing
the F9 key to update a Combo rowsource query!

Is there some definitive solution?

Please help, Frank who has Access2000

The Recalc method causes all calculated controls on the form to be
reevaluated.

The Requery method of a form causes the form's recordsource query to
rerun, possible returning a different set of records.

The Requery method of a combo or list box causes the control's rowsource
query to be rerun, possibly returning a different set of records for the
control's list.

The Requery method of a subform or OLE object causes the query on which
that object is based to be rerun.

The Requery method of a control for which the ControlSource includes a
domain aggregate function (e.g., DLookup(), DCount()) or a SQL aggregate
function (e.g., Count() or Sum()) causes the underlying or implicit
query to be rerun.

Calling the Requery method of any other object or control causes the
form itself to be requeried.
 
Top