inspectorgadjet
01-20-2009, 01:55 AM
I've created a table with a few columns and used a lookup on one of them. The lookup looks up items in another table which have a name and a price.
The user can select multiple items, and it then saves the list of items to the column. I need to also take the prices for the selected item and total them in another column but I'm struggling to figure out how. It was easy enough to get it displaying the price of the items when you are choosing the items but I'm stuck at that point.
I've done a bit of searching but haven't found what I'm after yet.
DCrake
01-20-2009, 02:25 AM
When you refer to columns I assume you mean fields?
You say you have used a lookup on one of your fields which inturn the user can select many items? How are you storing more than one item from the list into one field?
You need to be a bit more specific
David
inspectorgadjet
01-20-2009, 02:46 AM
Yes I meant fields. The lookup reads the items listed in the other table and allows you to tick multiple checkboxes. Once you click OK it places all the item names in a comma separated list in that field. When you have the drop down with items visible it also lets you display other columns from the table, so I am able to show the prices of items. I would like the prices to be added up once you click ok and then put into a field called Total.
DCrake
01-20-2009, 02:53 AM
Ok then at the point you are concatenating the items in the list box to insert into the field why not add the price of each item up at the same time and you will end up with a total.
If you post a sample of your work I will have a look at it for you.
David
Rabbie
01-20-2009, 02:57 AM
It is not good practice to use Look up fields in Tables which should only be used for storing data. Your end users should never see a table directly. if you want totals etc then use queries to calculate the values you want. Use Forms or reports to display the data.
See this link (http://mvps.org/access/lookupfields.htm)about look-up fields in tables