Well, one of the rules is to never store values that can be
calculated from other fields. It's possible for them to get
out of sync with the individual values and it's usually
faster to recalculate a value than save and load it along
with the longer records needed to keep the additional field.
Rather than updating records with this value, you could do a
DLookup on a SELECT query that calculates this combined
information in a report or form text box. If you need the
calculated value for a lot of records, you could join this
to whatever other data you are retrieving.
I don't fully understand the expression you are using to
calculate the combined value. You are using +, but it
appears that you are concatenating the individual items.
While + will do that for text strings, it also propagates
Null. Maybe that's what you want, but if not, use &
instead.
I can't be sure what you are doing here, but the part with
IIf(Len([category_ID])<2,'0'+CStr([category_ID]),CStr([category_ID]))
looks like it could be simplified to
Format(category_ID, "00")
and the other IIf to
Format(InventoryCounter, "0000000")
--
Marsh
MVP [MS Access]
"msnews.microsoft.com" wrote:
|