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

How to use a dropdown box that is unbound in a calculation?

Status
Not open for further replies.

gzuhlk

Programmer
Jul 11, 2003
9
0
0
US
Hi,
I am trying to perform a calculation on a 'form' with an unbound control(either a textbox or dropdown box). I don't know if this is possible. There is a bound dropdown box with all the product listed.

What I would like to do is have the user enter or select the QUANTITY and multiply it with the PRICE of a Product and place it in another unbound field called TOTAL. As the user selects other products and/or quantities, the total would change accordingly.

(My client wants a lot of interaction, wants to use the database for price projections).

Neither Quantity or Total are the Products table.

I think I am trying to do what is called a form query?

Can this be done simply in Access or do I have to program the front end in VB. I really need to do it in the simplest way because of time constraints.

I suppose I could make a control table with the price combinations, but I thought maybe the calculations could be done at form level.

Thanks,
gzuhlk
 
I would not do this at the form level..in your product table specify price of each product this way when the price changes all you have to do is change it in the table.

the total/qty text box does not have to be bound since you will simply multiply that by the qty and then I am assumming you would write that field(the total/qty text box) back to a table so you could have order history..

when the users select the product the price is auto filled in for them already.

 
Hi dvannoy,

I was planning on having the price per item in the products table.

This database will not be used for sales--it will be used to demo price/profit projections.

I guess the main question is:
Can I take a number from a textbox or dropdown box that is unbound and preform calculations with it? And then place the results in another text box.

gzuhl
 
of course..

simply say

txttotal = txt1 * txt2

or something like this..

 
OK,
That sounds way to simple!!!

Now--where in the heck to I put that statement--in the properites,or what.

Thanks again,
gzuhlk
 
it depends on you.. AfterUpdate or LostFocus will work good..



 
Thanks,

Will give this all a try. Later---need a break
gzuhlk

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top