Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Beginner wanting to know how to write a calculation

Status
Not open for further replies.

ViperD

IS-IT--Management
May 1, 2003
27
US
This is my first time coding in VB in Access. I'm trying to write code so that (in a form) when a text box (lets say box_1) loses focus, another text box (box_2) is automatically populated with the value of Box_1 * .065.

I would also like to know how to populate a text box that is in a different form.

Thanks in advance.
 
In answer to your first question:

in the On Exit event of Box_1 code:

me.box_2 = Box_1*.065.

For your second question: what are the specifics on the other form. How is it related to the first form? Is it a pop-up?

A simple answer to your question: Lets say you have form1 and form2. For this to work both form1 and forms2 have to be loaded.

In the controlsource of the field in form2 that you want to populate from the field in form1:

=forms!Form1.field1

This is the simple answer and may not work for you depending on the relationship between the forms.
 
I was thinking about my second question after I submitted the post. I need to think about what I need done a little more.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top