sequential number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am creating a new database that has assigned a file number, we have been
manually stamping these numbers on documents, now I would like access to
generate them, the number is a 6 digit number 59659, named Filed Number. I
would like access to sequentially number newly enterted records with the next
sequential number of 59660. I saw something in one of the posts
=DMax("ProductID","Product")+1 could I apply this here?
 
I am creating a new database that has assigned a file number, we have been
manually stamping these numbers on documents, now I would like access to
generate them, the number is a 6 digit number 59659, named Filed Number. I
would like access to sequentially number newly enterted records with the next
sequential number of 59660. I saw something in one of the posts
=DMax("ProductID","Product")+1 could I apply this here?

If the field is a Number datatype, yes.
Make it the Default Value for the field.

DMax("[Filed Number]","TableName")+1
 
See the following link for information about using this technique in a
multi-user environment. This is necessary if there is ever to be more than
one simultaneous database user.
 
that did not seem to work, I entered in the default table of the table -
Games of Chance - Master Table

=DMax("File Number","Games of Chance - Master Table")+1

an error message of: unknown Dmax expression in validation expression or
default value on "Games of Chance - Master Table.File Number'.
--
Ginny


fredg said:
I am creating a new database that has assigned a file number, we have been
manually stamping these numbers on documents, now I would like access to
generate them, the number is a 6 digit number 59659, named Filed Number. I
would like access to sequentially number newly enterted records with the next
sequential number of 59660. I saw something in one of the posts
=DMax("ProductID","Product")+1 could I apply this here?

If the field is a Number datatype, yes.
Make it the Default Value for the field.

DMax("[Filed Number]","TableName")+1
 
that did not seem to work, I entered in the default table of the table -
Games of Chance - Master Table

=DMax("File Number","Games of Chance - Master Table")+1

an error message of: unknown Dmax expression in validation expression or
default value on "Games of Chance - Master Table.File Number'.


What is "I entered in the default table of the table"?

1) The expression goes in the Default Value property of the "[File
Number]" control on the form (not in the table).

2) Do not use the = sign.

3) ALWAYS surround field names (and table names) that include a space
with brackets.... (That's why it's good database design to NEVER use a
space within a field or table name).

Try:
DMax("[File Number]","[Games of Chance - Master Table]")+1

on the [File Number] control's Default Value property line.

If there are no existing records, then use:

DMax("Nz([File Number],0)","[Games of Chance - Master Table]")+1
 
Thank you, that worked Great!! I greatly appreciate the assistance!!

Ginny6
--
Ginny


fredg said:
that did not seem to work, I entered in the default table of the table -
Games of Chance - Master Table

=DMax("File Number","Games of Chance - Master Table")+1

an error message of: unknown Dmax expression in validation expression or
default value on "Games of Chance - Master Table.File Number'.


What is "I entered in the default table of the table"?

1) The expression goes in the Default Value property of the "[File
Number]" control on the form (not in the table).

2) Do not use the = sign.

3) ALWAYS surround field names (and table names) that include a space
with brackets.... (That's why it's good database design to NEVER use a
space within a field or table name).

Try:
DMax("[File Number]","[Games of Chance - Master Table]")+1

on the [File Number] control's Default Value property line.

If there are no existing records, then use:

DMax("Nz([File Number],0)","[Games of Chance - Master Table]")+1
 
I'm trying to do the same thing but I keep having a problem. Here is my code:

Function SequentialNumber()
DMax("Nz[BITEM],0)", "[Text1]")+1
End Function

I get a "Compile Error: Syntax Error" message. What am I doing wrong?

fredg said:
that did not seem to work, I entered in the default table of the table -
Games of Chance - Master Table

=DMax("File Number","Games of Chance - Master Table")+1

an error message of: unknown Dmax expression in validation expression or
default value on "Games of Chance - Master Table.File Number'.


What is "I entered in the default table of the table"?

1) The expression goes in the Default Value property of the "[File
Number]" control on the form (not in the table).

2) Do not use the = sign.

3) ALWAYS surround field names (and table names) that include a space
with brackets.... (That's why it's good database design to NEVER use a
space within a field or table name).

Try:
DMax("[File Number]","[Games of Chance - Master Table]")+1

on the [File Number] control's Default Value property line.

If there are no existing records, then use:

DMax("Nz([File Number],0)","[Games of Chance - Master Table]")+1
 
I'm glad you mentioned multi user because we are going to have one, where is
the link ?
 
Back
Top