Listbox Troubles

  • Thread starter Thread starter Jimbo51
  • Start date Start date
J

Jimbo51

Hi all,

I have a form linked to a table, this form also has a listbox with th
rowsource linked to a query based on the same table. When u click th
pickup button it sets the playerobtained field to true and the recor
appears in the query (having matched the criteria). My problem is whe
u click the button the listbox does not update, although when u move t
the next record and back again and then click the button, the listbo
does update. I have checked and the query is updating, just not th
listbox.

query sql:
SELECT Room.InventoryName, Room.PlayerObtained
FROM Room
WHERE (((Room.PlayerObtained)=True));

I use a macro to update the table and have tried the requery functio
with no luck
 
Hi,

A list (in a list box or in a combo box) is not automatically updated.
For a combo box, you can wait the GotFocus event, to do something like:

Me.ComboBoxName.RowSource = Me.ComboBoxName.RowSource

(since the statement didn't change, you just want to requery it; if the SQL
statement did change, supply the new one). For a list box, it is advisable
to do the same requerying, but in the event that "creates" the potential
change (ie, here, in the button click event).


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top