newbie default value question

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
 
W

Wayne Morgan

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
 
E

Em

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


.
 

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

Similar Threads


Top