Requery two fields? I only asked for one

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
 
S

Stuart McCall

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.
 
R

Robert

That works.

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

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