Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

How requery a value in a 2nd form

I have two forms.  One form, form 1, has a numeric value that I enter.  When that form is closed, I want that same field which is displayed on the other form, form 2, to represent the value on the first form.  I've tried Form_form1.txtCurrentBalance.Requery but it doesn't work.

Avatar of Bitsqueezer
Bitsqueezer
Flag of Germany image

Hi,

"Requery" is to reload the data from a bound underlying table into bound fields.
So it's not clear what you want to perform. If you have a form bound to a table (better: query) and one of the fields should get a value you enter in a further form, you are responsible to forward the value to this form.
One of many possible ways is to directly access form2 from form1 using the Forms collection (which contains all loaded forms). After you have changed txtCurrentBalance from form1 it has the value and no requery is needed (and Requery also sets the record bookmark to the first in the list, which also saves the current record if it was already changed).

Cheers,

Christian
Avatar of SteveL13

ASKER

What is Forms Collection?

SOLUTION
Avatar of Noah
Noah
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Glad to help. Cheers! :)