Combo Box not refreshing

  • Thread starter Steven R via AccessMonster.com
  • Start date
S

Steven R via AccessMonster.com

When I select a value in a combo box, the bound column value continues to
appear in the (combo) box - I also have a list box on my form that if the
user were opening up the form, they could click on an item, and see the
correct value in the field in my combo box, which happens to be the
"CommCode" in this case. But when I add a new record, and select a commodity
code ( "CommCode" ) or if I update the CommCode field in an existing record,
it updates the record properly one time, but that same comm code stays on the
screen. Again, if they scroll throgh records, that same comm code stays up
on the screen.

I don't have a control source for my combo box - it updates fields in my
underlying table with the following :

Me!SourcingTeam = cboCommCode.Column(3)
Me!Buyer = cboCommCode.Column(2)
Me!CommCode = cboCommCode.Column(0)

....In the AfterUpdate event of the Combo Box.

Any help would be greatly appreciated

Steve
 
B

Baz

Steven R via AccessMonster.com said:
When I select a value in a combo box, the bound column value continues to
appear in the (combo) box - I also have a list box on my form that if the
user were opening up the form, they could click on an item, and see the
correct value in the field in my combo box, which happens to be the
"CommCode" in this case. But when I add a new record, and select a commodity
code ( "CommCode" ) or if I update the CommCode field in an existing record,
it updates the record properly one time, but that same comm code stays on the
screen. Again, if they scroll throgh records, that same comm code stays up
on the screen.

I don't have a control source for my combo box - it updates fields in my
underlying table with the following :

Me!SourcingTeam = cboCommCode.Column(3)
Me!Buyer = cboCommCode.Column(2)
Me!CommCode = cboCommCode.Column(0)

...In the AfterUpdate event of the Combo Box.

Any help would be greatly appreciated

Steve

As you say, the combo box has no control source i.e. it is unbound. Access
can't change the combo box's value for each record if the combo box is not
bound to any field. It has no way of knowing where to get the value from,
so it simply continues to display whatever you last entered.

It seems likely to me that you have a basic design flaw here. If a specific
CommCode necessarily implies a specific SourcingTeam and a specific Buyer,
then you have no need of SourcingTeam and Buyer fields on your record: you
can (should) simply derive them from a CommCodes lookup table whenever you
need to. Storing derived data in your database, instead of deriving it
whenever needed, is a fundamental no-no of database design.

Anyhow, you can easily solve your specific problem by setting the
ControlSource of the combo box to CommCode, and removing the third line from
your code snippet above.
 

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