Populating a field on a form using default property

  • Thread starter Thread starter Danny Jacobs
  • Start date Start date
D

Danny Jacobs

My form has multiple rows (records).
The form is based on a simple table (say table1).
The table has 3 fields (say field1, field2 and field3).
I would like the value of field1 for the next new row to default to the
highest previous value of field1 (i.e. MAX value for [table1].[field1]).

I have been trying to achieve this result by entering a select statement in
the default property for the form field but this does not seem to work. Any
ideas?
 
try setting the Field1Text.DefaultValue to
DMAX("[field1]", "table1")
if the form has a condition, place the condition as the
third argument.
-> Note that the name of your text box should be differnt
from "field1", ("field1text" is a good name) because
expressions like
field1.defaultValue = func(field1) usually end in #Error.
 
Back
Top