Requery two fields? I only asked for one

  • Thread starter Thread starter Robert
  • Start date Start date
R

Robert

When the listbox is clicked on a popup form, I have to set one field
(textbox) value on a subform which is on the mainform as well as requery two
more fields (textboxes) on this subform. These two fields are both bound to
Dlookup's. I use the following code to reset one of the fields:

Forms!frmMain!subfrmSub.Form!txtBox1.Requery

And voila both of the fields have been reset. While the result is exactly
what I wanted, I'm puzzled as to why and would like to requey both textboxes
the correct way.

Robert
 
Robert said:
When the listbox is clicked on a popup form, I have to set one field
(textbox) value on a subform which is on the mainform as well as requery
two more fields (textboxes) on this subform. These two fields are both
bound to Dlookup's. I use the following code to reset one of the fields:

Forms!frmMain!subfrmSub.Form!txtBox1.Requery

And voila both of the fields have been reset. While the result is exactly
what I wanted, I'm puzzled as to why and would like to requey both
textboxes the correct way.

Robert

When you say your textboxes are bound to dLookups I presume you mean that
you have:

=DLookup(...

in their controlsource properties. If so try this:

Forms!frmMain!subfrmSub.Form.Recalc

That ought to refresh both controls. It requests a re-evaluation of
calculated fields by the expression service.
 
That works.

I was wondering why it requeries a field when I never issued such a command.
 
Back
Top