Combo box requery problem

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

Hello-

I have read multiple posts on this and am still having trouble. I have
an unbound combo on a form that fills 3 other bound text boxes when a
value is selected in the combo box. The record source for the form is a
query. When I navigate between records, the bound text boxes change
information, but the Combo displays the same info between record
navigation. I have set requery on both the combo's after update event
and the forms on current event (Me.cboItemNum.Requery).

Why doesnt the info in the combo change? Should it? I think one of the
MVP's said it should not be changing. When I look at the recordset in
the undelying query all the information is correct, and it is from this
query that I will base my reports. In that sense I guess I am ok, but I
don't want the users of the database to become confused if they start
navigating records and see that the item code combo is not changing
along with the other 3 text boxes containing item information
(description, manufacturer code, manufacturer name). Any ideas on this
would be greatly appreciated.

Thanks-

Scott Sabo
 
When you move record, Access automatically loads all bound controls with the
value of the field/expression they are bound to.

If your combo is unbound (nothing in its Control Source property) then
Access has not been instructed to set its value to anything in the record
you just moved to. As a result, all unbound controls just stay the same
value: no change was specified.

If you want to set the value of an unbound control when you change record,
you can do that in the Current event of the form.

Alternatively, if you are using the unbound combo for a purpose such as
finding a record, you could set it to Null again so as not to confuse your
users.
 
I already have this code in the current event of the form, but the
combo still does not change when navigating:

Private Sub Form_Current()
Me.cboItemNum.Requery
End Sub

Any ideas?
 
I am also having a problem with the underlying query. If i am in my
form and I delete the Item Number from the resord, it deletes the item
number in the Items table. The Item Number field on the form is
unbound, why is this happening, it is driving me nuts.
 
Requerying the combo will do nothing

Presumably you want the combo to stay syncronized with the value in one of
the fields. For example, if the unbound combo's Bound Column is the ClientID
field, then in Form_Current you will want:
Me.cboItemNum = Me.ClientID
 
Well, of course.

Forms have no records of their own: they read and write the records in a
table. So if you delete the record from the form, you are actually deleting
it from the source table.
 
Back
Top