Storing data in a table

D

D Kucey

I am using a combo box on a form to enter data. The name
that I chose in the combo box also has a value to it. Ex.
I chose Product 1 and it comes with a price of $25. My
price of course comes from my Products table.


My problem is that I want to store that price in a Orders
Details table. The tricky part is that I want to be able
to change that price later on if I want to so I can give
the customer a discount and without touching the Products
table.

I have been looking at the Northwinds db and I can not
figure out how they do it with the Orders form. I want
to use the same concept, where I click on a product and
the unit price automatically comes up. That unit price
comes from the Products table and is stored in the Order
Details table but it can be changed if desired.

Any help would greatly be appreciated.
Thanks
 
T

Tim Ferguson

My problem is that I want to store that price in a Orders
Details table. The tricky part is that I want to be able
to change that price later on if I want to so I can give
the customer a discount and without touching the Products
table.

The easiest way is to attach some code to the cboChooseAProduct_AfterUpdate
event which looks up the current price in the table and pushes it to the
txtPriceCharged textbox on the form.

HTH


Tim F
 

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