Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't requery ComboBox when based on a Query 1

Status
Not open for further replies.

djayam

Technical User
Aug 16, 2005
95
GB
Hi all,

I have an unbound form that contains a combo box. This combo box has a rowsource set OnOpen:

Code:
    Me.Combo_Suppliers.RowSource = "SELECT DISTINCT qry_rpt_BaseData2.SupplierID, qry_rpt_BaseData2.Supplier FROM qry_rpt_BaseData2 ORDER BY [Supplier]"

On 1st run this works fine. However, some other controls on the form will often force the SQL of the underlying query (qry_rpt_BaseData2) to change. This is intentional. My problem is the combo box list doesn't reflect the change. I have added the following into the OnEnter event of the combo box:

Code:
Me.Combo_Suppliers.Requery
Me.Combo_Suppliers.Dropdown

but it doesn't seem to work. I know the SQL is changing OK as other combo boxes look at the updated query (as long as they haven't already been "opened").

The Requery and Dropdown events are working OK all over my db but all other combos use table rather than queries - what am I missing??!!

Thanks loads,

Jason
 
You may try to replace this:
Me.Combo_Suppliers.Requery
with this:
Me.Combo_Suppliers.RowSource = Me.Combo_Suppliers.RowSource

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV - you are a genius! Thank you so much. Seems very odd though...ah well it worked - thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top