How can I customize the "default value" in a field

V

Vidal Castillo

I am an acces beginner, so please be patient.
I have a field in a TABLE called "IvoiceNr"; I want its
"DEFAULT VALUE" to be the number of the higher number typed
in the column. e.g.: My higher value in the column was 135,
so the "DEFAULT VALUE" is 136.

What expression do I have to write down, in the "default
value field" , so that I can get this value?

Note: In the column may be fields without value, I just
want the higher number in the column.

Thanks
 
B

Brendan Reynolds

You can't do that in a table. You can, however, do it in a form, by entering
an expression such as the following as the Default Value property of a text
box ...

=DMax("[TestNumber]","tblTest")+1

.... where "TestNumber" is the name of the field, and "tblTest" is the name
of the table. See "DMax Function" in the help file for details.
 
V

Vidal Castillo

Thanks for the information, it really helped me. Have a
nice day

-----Original Message-----
You can't do that in a table. You can, however, do it in a form, by entering
an expression such as the following as the Default Value property of a text
box ...

=DMax("[TestNumber]","tblTest")+1

.... where "TestNumber" is the name of the field, and "tblTest" is the name
of the table. See "DMax Function" in the help file for details.

--
Brendan Reynolds (MVP)


I am an acces beginner, so please be patient.
I have a field in a TABLE called "IvoiceNr"; I want its
"DEFAULT VALUE" to be the number of the higher number typed
in the column. e.g.: My higher value in the column was 135,
so the "DEFAULT VALUE" is 136.

What expression do I have to write down, in the "default
value field" , so that I can get this value?

Note: In the column may be fields without value, I just
want the higher number in the column.

Thanks


.
 
Top