Hi there,

I have a form that adds a Customer to a database. I had set the cust_id in the Ms Access as an Autonumber. and when I open the vb form, i wrote a code that will set the textbox of the cust_id as the count of the records + 1. That is displayed correctly.

my problem is this. When I click on the button save i have the following code attached

me.databinding(dataset11, "Customer").addnew()
oledb_Cust.fill(dataset11)

it's telling me that since the cust_id is a primary number, it's doesn't allow it to be null. Now i'm generating that number as i specified in the first paragraph.

any help?

Thanks
Luke

As I understand it ur not supposed to be inserting anything in the auto number field, Access should take care of that automaticaly.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.