Auto Number to increase by 3

M

monster

I'm trying to add a field named Sequence and I would like the default value
to be in increments of 3. This is for requesting bill of materials.

The following is the BOM form.
Parent ##-####
Sequence Component Quantity
3 ##-#### 1
6 ##-#### 1
9 ##-#### 1
12 ##-#### 1

I use the BOM form as a sub form.
I will have differerent Bill of materials for each individual Parent.

Please let me know if this is possible if not please advice of another
method.
 
S

Sprinks

Hi, Monster.

An AutoNumber field is best suited just to provide a unique identifier. If
records are deleted, the missing number may be used again.

When you care about the sequence, and in your case, the increment, you're
much better off with a generic integer field. You can use DMax() to
determine the sequence number of the last record, then increment to the next
one.

Sprinks
 
M

monster

I tried the following in the Sequence field:
=DMax("Sequence","BillOfMaterialAssy")
but I get an error message that reads:

Unknow function 'DMax' in validation expression or default value on
'BillOfMaterialAssy.Sequence'.

What am I doing wrong?
 
M

monster

I tried the following in the Sequence field:

=DMax("Sequence","BillOfMaterialAssy")

But I got this error message:

Unknown function 'DMax' in validation expression or default value on
'BillOfMaterialAssy.Sequence'.

What am I doing wrong?
 
S

Sprinks

Hi, Monster. Whenever possible, use VBA Help by cutting and pasting from an
example, and filling in your specific requirements. In this case, the DMax
example is:

=DMax("[Freight]", "Orders", "[ShipRegion] = 'CA'")

which is telling you that you need to dellimit the field by enclosing it in
brackets.

Try:
=DMax("[Sequence]","BillOfMaterialAssy")
 
Top