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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Functions Using Two Tables

Status
Not open for further replies.

doorok

Technical User
Mar 20, 2003
10
0
0
US
I have two tables in Access. Table1 contains a field for Items and a second field with a Percent for each item. Table2 contains a field for a Customer's Name, a field for Items, and a field for Charges. What I have done is set up a form that will let me enter in the Customer's Name, select the Item (purchased) from a combo box with row source Items from Table1, and input a Charge in the Charges field (any dollar amount). This I can do with no problem. I'm having a problem when I try to multiply the number I entered in the Charge field by the Percent from Table1 that corresponds to the Item chosen from the drop down menu with row source table one. I then want this amount to output into a calculated form field that I called Amount. I am unable to get the calculation to work and all I get in the Amount field is the error #Name? Anybody have any advice.
 
The way that I would do this form would to bring down both the Item # and the percent in the combo box. The percent would be the second item and have a lenght of 0 inches(found in the properties list of combo field).

Then use an Exit Event on the Change field to do the calculation. That would be "Change * Item.column(1)". The Item.column(1) is the percent form Table 2. Item.column(0) is the Item itself.

Hope you can understand my jargen and hope it helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top