Populate a text box value based on another text box value

G

Guest

I want to populate a text box value based on the input from another text box.
Can I do this?
 
G

Guest

If the second text box's value is always determined by the first then the
second should be an unbound control whose ControlSource property references
the first text box. Say you want the second text box to show a value of the
first one's value plus 10 per cent:

=[txtFirst] * 1.1

The first text box can be bound to a field n the form's underlying table or
can itself be an unbound text box on a dialogue form.

If you want to be able to edit the value in the second text box rather than
have it immutably derived from the first, then you should 'push' the value
into it rather than 'pull' it in as above. This is done by assigning a value
to the second text box in the AfterUpdate event procedure of the first text
box, e.g.

Me.txtSecond = Me.txtFirst * 1.1

Ken Sheridan
Stafford, England
 

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