autonumber problem

  • Thread starter Thread starter Ezekiël
  • Start date Start date
E

Ezekiël

Hello,

I have 2 problems with autonumber in a form. I use sql server as back-end,
but when adding records i don't see the autonumber.
Also i use primary field where it values comes from the autonumber, which
results in a error that it cannot insert null values (duhh).

How can i resolve this issue?
 
Ezk:

Are you using code to add the records, such as the AddNew method, a form,
aor directly into a table? Are you using linked tables?

I believe I had the same problem somewhere along the line, converting the
backend to SQL Server. I think I resolved it by inserting the value into the
field, by determing the next number. You can use the DMax function on the
field, than add 1 to it.

God Bless,

Mark A. Sam
 
Hi mark,

I directly insert the records into linked tables. Is adding records by code
better to use or does it make no difference?

Do you have an example how to use dmax?

Thx

Ezekiel
 
Ezk,

In serting directly into the table shouldn't be a problem for an autonumber.
It won't increment and display however until you move off of the record.

I think you need to open the table in design view using Enterprise Manager
and check the properties of the other fields for any with the Allow Null
property = False.

God Bless,

Mark A. Sam
 
Back
Top