Question Automaticaly dispalying and adding prices to a table

Andrew_w

Registered User.
Local time
Today, 07:11
Joined
Jun 24, 2008
Messages
13
Hey all. I am new to this forum so am not sure if this is the right section to post this to.

My question is this: Suppose we are selling computers and have only five types of computers: Samsung, Sony, Dell, HP and MAC. Lets suppose each of these computers have a fixed price of 500, 600, 700, 800 etc....

How do I make the price come up automatically each time a customer orders a certain computer? How then would I be able to store this into a table?

Your help is reallllyyy appreciated. Thank you, Andrew.
 
Include the price column in the RowSource query of the combo you use to select the computer type. The price column does not have to be visible. Make sure that you update the column count and column headers whenever adding/deleting columns of the RowSource.

In the AfterUpdate event of the combo, place the price value in the SoldPrice column of the OrderDetail record.

me.SoldPrice = Me.cboComputerType.Column(3)

The actual column number should be the one that holds the computer price. The columns of the RowSource are a zero-based array so .Column(3) actually refers to the 4th column of the RowSource. Adjust this number as necessary.
 
Hey Pat, thanks for your answer.

Access keeps telling me that it does not recognise Me.

What I have done is in the table itself in the look up bit, I entered the values in the raw source, such as "dell" etc, and the raw source type is a value list.

In the properties of the combo box, the raw source are a query which only includes the computer and pirce grouped by.

I don't quite grasp what do you mean by columns. Sorry I am rather new.
 
Each field in the select clause of the query is a column.
Select ComputerID, ComputerDesc, ComputerPrice from YourTable Order by ComputerDesc;

There are 3 "columns" in this query. Humans think of them as column1, column2, and column3. Computers think of them as column0, column1, and column2.

You may have entered the code into the property rather than into a code module. Press the builder button (three dots) to the right of the property field. This will give you three options (unless you have set it to default to code). Choose the option to create a procedure. VBA code goes into procedures not in property values.

Post the code and we'll help you further.
 
You may have entered the code into the property rather than into a code module. Press the builder button (three dots) to the right of the property field. This will give you three options (unless you have set it to default to code). Choose the option to create a procedure. VBA code goes into procedures not in property values.
And here's a visual on that same procedure:

http://www.btabdevelopment.com/main/QuickTutorials/Wheretoputcodeforevents/tabid/56/Default.aspx
 
Thank You Pat, I have sorted it out now. Your help has been Priceless.

And thank you too Bob, I'll look around that site, seems very helpful.
 

Users who are viewing this thread

Back
Top Bottom