Combobox/NotInList/Requery problem

G

Gitche Gumee

I am using the NotInList event of a combobox on a form (frmOrderDetails) to
open another form (frmProducts) for entry of the new item in the Products
table. OpenArgs is used to pass NewData and populate the appropriate field
(ProductID) in the Products form. That works fine.

What I would like to do is then take the ProductID back to the OrderDetails
form, requery the ProductID combobox, and populate other fields on the
OrderDetails form (ProductDescription and UnitPrice) without retyping the new
ProductID. That's working fine too.

The problem is that requerying the combobox and populating the other fields
is overriding whatever it is that triggers the Access response to entering
data in a new record. That is, when an item in the list is selected in
cboProductID, a new row is generated below the current record. This is normal
behavior. But when the item is not in the list and I add it as described
above, a new row does not appear. Tabbing through all the fields in the
current record ends up taking me to the next order, not the next (new)
OrderDetails record. Returning to the order I was working on makes the "new"
row appear so that's the workaround for now.

Additional info: frmOrderDetails is a subform displayed in Datasheet view.

I know you will probably need my code; I'll post it when I'm back at home.
But I wanted to get this posted and see if anyone has seen this behavior.
Thanks.
 
H

HartJF

Gitche Gumee said:
I am using the NotInList event of a combobox on a form (frmOrderDetails) to
open another form (frmProducts) for entry of the new item in the Products
table. OpenArgs is used to pass NewData and populate the appropriate field
(ProductID) in the Products form. That works fine.

What I would like to do is then take the ProductID back to the OrderDetails
form, requery the ProductID combobox, and populate other fields on the
OrderDetails form (ProductDescription and UnitPrice) without retyping the new
ProductID. That's working fine too.

The problem is that requerying the combobox and populating the other fields
is overriding whatever it is that triggers the Access response to entering
data in a new record. That is, when an item in the list is selected in
cboProductID, a new row is generated below the current record. This is normal
behavior. But when the item is not in the list and I add it as described
above, a new row does not appear. Tabbing through all the fields in the
current record ends up taking me to the next order, not the next (new)
OrderDetails record. Returning to the order I was working on makes the "new"
row appear so that's the workaround for now.

Additional info: frmOrderDetails is a subform displayed in Datasheet view.

I know you will probably need my code; I'll post it when I'm back at home.
But I wanted to get this posted and see if anyone has seen this behavior.
Thanks.

I have a similar issue: The primary key (string x3) is bound to my combo
box but only another field (string x15) is visible. My return command
(combobox=popup!key) triggers NotInList again, but if I change the return to
combobox=popup!data, a system error, value too long for field, occurs.
 

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