DMax and Autonumber

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??
 
S

Steve Schapel

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
 

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

Top