My recordset is based on an updatable query that includes four parallel left joins.
Basically what's happening is a shopping basket. Items are added en masse (in code) and then we go through each item (e.g. avatars) in code selecting the attributes we want (black hat, blue jacket, red shoes, long beard, etc), each pulled from an unbound combo control on the form. The attributes are independent of each other. The selections come from the left joins. It's not quite as simple as that, but you get the idea.
My problem only occurs when the items have just been added to the shopping basket. The recordset has been requeried, and one of the selections has been made (the three other values are zero). The update for the second selection fails with the error 'You cannot change a record because a related record is required in [MyRelatedTable]'.
This one beats me. The first selection updated into the recordset fine. The primary key of [MyRelatedTable] is included in the query. The immediate window shows that the correct value of [MyRelatedTable].primary key is present in the current record just before the update method for the second attribute.
I suspect either:
a) something is wrong with the recordset properties, which include:
.CursorLocation = adUseServer
.CursorType = adOpenStatic
.LockType = adLockOptimistic
b) or, grasping at straws here, whatever allows zero values for the four attributes is doing so inconsistently, so that it accepts:-
hat = black
jacket = 0
shoes = 0
beard = 0
but not:-
hat = black
jacket = red
shoes = 0
beard = 0
Lastly, it's a split database, in Access 2010.
Any thoughts anyone?
Basically what's happening is a shopping basket. Items are added en masse (in code) and then we go through each item (e.g. avatars) in code selecting the attributes we want (black hat, blue jacket, red shoes, long beard, etc), each pulled from an unbound combo control on the form. The attributes are independent of each other. The selections come from the left joins. It's not quite as simple as that, but you get the idea.
My problem only occurs when the items have just been added to the shopping basket. The recordset has been requeried, and one of the selections has been made (the three other values are zero). The update for the second selection fails with the error 'You cannot change a record because a related record is required in [MyRelatedTable]'.
This one beats me. The first selection updated into the recordset fine. The primary key of [MyRelatedTable] is included in the query. The immediate window shows that the correct value of [MyRelatedTable].primary key is present in the current record just before the update method for the second attribute.
I suspect either:
a) something is wrong with the recordset properties, which include:
.CursorLocation = adUseServer
.CursorType = adOpenStatic
.LockType = adLockOptimistic
b) or, grasping at straws here, whatever allows zero values for the four attributes is doing so inconsistently, so that it accepts:-
hat = black
jacket = 0
shoes = 0
beard = 0
but not:-
hat = black
jacket = red
shoes = 0
beard = 0
Lastly, it's a split database, in Access 2010.
Any thoughts anyone?
Last edited: