E
estebistec
Hello,
I have a subform running in continuous mode to edit child records.
Specifically, the records are "order items", whose parents are orders.
Not only that, but order items refer to the item being "instantiated"
in the order. So they are really line-items indicating items that
vendors provide.
Now for the problem. I'm allowing the ItemCode to be selected from a
combobox, and I want the user to be able to enter a new, first-time
item code. This is NOT the relation represented by the subform linking
(order to order-item). So my strategy is to capture ItemCode_OnExit or
Form_BeforeUpdate or whatever else might apply to attempt to pre-create
the required item record. Invariably, I get:
The Microsoft Jet database engine cannot find a record in the table
'Item' with key matching field(s) 'ItemCode'.
Now I've searched around in these forums so I've seen people reporting
this error message, and being told to ensure the parent record of the
relationship is there. But remember, I'm adding this via code. Further,
I'm even tracing code and seeing in the table that the record has been
created, an Item with the specific ItemCode. Still, it tells me that
the existing item code can't be found in the table. So access won't
save the current new record, and on trying to exit I get the ugly
messages about a record that it can't save, so on and so forth.
I was thinking that using the event methods would be more
straightforward than this. What else can be going wrong here? Thanks.
I have a subform running in continuous mode to edit child records.
Specifically, the records are "order items", whose parents are orders.
Not only that, but order items refer to the item being "instantiated"
in the order. So they are really line-items indicating items that
vendors provide.
Now for the problem. I'm allowing the ItemCode to be selected from a
combobox, and I want the user to be able to enter a new, first-time
item code. This is NOT the relation represented by the subform linking
(order to order-item). So my strategy is to capture ItemCode_OnExit or
Form_BeforeUpdate or whatever else might apply to attempt to pre-create
the required item record. Invariably, I get:
The Microsoft Jet database engine cannot find a record in the table
'Item' with key matching field(s) 'ItemCode'.
Now I've searched around in these forums so I've seen people reporting
this error message, and being told to ensure the parent record of the
relationship is there. But remember, I'm adding this via code. Further,
I'm even tracing code and seeing in the table that the record has been
created, an Item with the specific ItemCode. Still, it tells me that
the existing item code can't be found in the table. So access won't
save the current new record, and on trying to exit I get the ugly
messages about a record that it can't save, so on and so forth.
I was thinking that using the event methods would be more
straightforward than this. What else can be going wrong here? Thanks.