Hello
I'm really stuck, with a piece of code that has worked in the past, but doesn't now.
It adds a record to an ADO recordset based on an SQL query which joins 2 tables. The same unique ID must end up in the primary key of both tables.
The primary key of one of the tables is an AutoNumber field. The primary key of the other table is indexed, but not autonumber. The same value is assigned by code from the Autonumber field, before updating.
The problem is, that autonumber field retains a null value, so the primary key of the other table also retains a null value, which causes an error (Primary key can't contain a null value) when it hits the update command.
I've tried using the Update Resync property, to no avail.
Any suggestions for how I might avoid this problem?
Code attached
thanks (in advance) for your help
Dan
I'm really stuck, with a piece of code that has worked in the past, but doesn't now.
It adds a record to an ADO recordset based on an SQL query which joins 2 tables. The same unique ID must end up in the primary key of both tables.
The primary key of one of the tables is an AutoNumber field. The primary key of the other table is indexed, but not autonumber. The same value is assigned by code from the Autonumber field, before updating.
The problem is, that autonumber field retains a null value, so the primary key of the other table also retains a null value, which causes an error (Primary key can't contain a null value) when it hits the update command.
I've tried using the Update Resync property, to no avail.
Any suggestions for how I might avoid this problem?
Code attached
thanks (in advance) for your help
Dan