newbie default value question

  • Thread starter Thread starter Em
  • Start date Start date
E

Em

I would like a default value to appear on a form AND the
corresponding table. The value needs to be the last /
largest number previously entered in a field in the table.

In a report, I used "Last Of [desired field]", and it
worked great for what I needed it for.. is there
something similar I can do in a form? Will a default
value in a form be placed into the table? (I have not
been successful in getting calculated values on forms to
go into the table)

Help please? How can I do this???

Em
 
You can't do this in a table, but it will work in a form and when the new record is saved,
it will be written to the table if a value in that field would have been anyway (i.e. the
control is bound to the field).

Use the DMax function to refer to the field and table you want to get the maximum value
from and place it in the DefaultValue of the control.

Example:
=DMax("[Field1]","Table1")+1
 
Excellent. Thank you.

-----Original Message-----
You can't do this in a table, but it will work in a form
and when the new record is saved,
it will be written to the table if a value in that field
would have been anyway (i.e. the
control is bound to the field).

Use the DMax function to refer to the field and table
you want to get the maximum value
from and place it in the DefaultValue of the control.

Example:
=DMax("[Field1]","Table1")+1

--
Wayne Morgan
Microsoft Access MVP


I would like a default value to appear on a form AND the
corresponding table. The value needs to be the last /
largest number previously entered in a field in the table.

In a report, I used "Last Of [desired field]", and it
worked great for what I needed it for.. is there
something similar I can do in a form? Will a default
value in a form be placed into the table? (I have not
been successful in getting calculated values on forms to
go into the table)

Help please? How can I do this???

Em


.
 
Back
Top