DMax and Autonumber

  • Thread starter Thread starter Tom Hart
  • Start date Start date
T

Tom Hart

I have an employee table with the key field as
autonumber. I use a second table as a temporary when
inputting new data so I can back out the change if need
be. I use an Append query to add records from the
temporary table to the other. My problem is trying to
enter the first record into the table; DMax
("EmpID","tblEmployee")+1 does not work because EmpID is
Null. It works fine when I have one or more records
already in the table. Any suggestions??
 
Tom,

I am a little confused about what you are doing, as you can't really
control the value of an Autonumber like this. But anyway, does this
help?...
Nz(DMax("[EmpID]","tblEmployee"),0)+1
 
Back
Top