sequential number

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?
 
F

fredg

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
 
B

BruceM

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.
 
G

Guest

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
 
F

fredg

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
 
G

Guest

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
 
G

Guest

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
 
T

tankerman

I'm glad you mentioned multi user because we are going to have one, where is
the link ?
 
T

tankerman

Bruce thanks for the link, I will do as requested because I can use the
sample I believe.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top