autonumber problem

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

Mark A. Sam

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
 
E

Ezekiël

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
 
M

Mark A. Sam

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
 

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