Re: Convert string to code



This table needs to be redesigned, so your data is normalized.

There are 2 fundamental flaws in the table as it stands:
a) It contains dependent values (the Total that depends on other fields),
and
b) It contains repeating fields (similar entities in different colums.)

Remove all the price fields from this table.
Instead, create another table with fields:
AmountType drop-down list for "Price", "Shipping", or "Tax"
Amount Currency. The amount for this row.
ForeignID relates to the primary key of your main table.

You can then sum the values in this one Amount field, to get the total for
the invoice/order or whatever it is.

For a basic example of this kind of structure, open the Northwind sample
database that installs with Access. Choose Relationships on the Tools menu.
You will see how one order has many rows, so there is an Order Details table
related the Orders table. That's the basic idea.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Steve" <Steve@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:04F17C49-F573-40B5-AE76-899942521AE1@xxxxxxxxxxxxxxxx
I have table that must be manipulated differently for each record. In each
record, I have a field that I have stored the manipulation necessary. For
example, one record might say "Price+Total-Shipping"(fields in the
record),
while the next record might say "Price+Shipping+Taxes". What would be the
best way to loop through the records and have that manipulation done on
another field in the record?

In other words, loop through the records, look at the calculation, do the
calculation and put the result in an existing field in the record, move on
to
the next.

Query? Form? What code?

Thanks so much..


.


Loading