How do I calculate a sum between a combo box and an input box?

G

Guest

I have a form and report to track my inventory. On my parts form, I have the
cost as a combo box (which is linked to my parts table), but the units issued
are manually input by me. I need to calculate a total cost per issue like
this (cost*unitsissued). I have named the combo box "cost". However, when I
use the sum function as follows [cost]*[unitsissued], I get a total like
listed below:

Cost = $2.15
Issues = 10
Total = $5,690.00

Can someone please tell me what I've done wrong in my sum function?
 
P

pietlinden

I have a form and report to track my inventory. On my parts form, I have the
cost as a combo box (which is linked to my parts table), but the units issued
are manually input by me. I need to calculate a total cost per issue like
this (cost*unitsissued). I have named the combo box "cost". However, when I
use the sum function as follows [cost]*[unitsissued], I get a total like
listed below:

Cost = $2.15
Issues = 10
Total = $5,690.00

Can someone please tell me what I've done wrong in my sum function?
Normally, it would be something like
Me.Controls("txtIssues") * Me.Controls("cboItem").Columns(2)

Sounds like your design is not right. You should check out Allen
Browne's inventory/QOH example... www.allenbrowne.com, then look for
tips for experienced users, then Quantity On Hand.
 
J

John W. Vinson

I have a form and report to track my inventory. On my parts form, I have the
cost as a combo box (which is linked to my parts table), but the units issued
are manually input by me. I need to calculate a total cost per issue like
this (cost*unitsissued). I have named the combo box "cost". However, when I
use the sum function as follows [cost]*[unitsissued], I get a total like
listed below:

Cost = $2.15
Issues = 10
Total = $5,690.00

Can someone please tell me what I've done wrong in my sum function?

My guess is that the bound column of the combo box is some numeric ID
(containing 596 for this record); what's *displayed* is $2.15 but what's
actually in the combo is its ID number.

What's the RowSource property of the combo? Could you post the SQL and
identify the datatype of the fields involved?

John W. Vinson [MVP]
 

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