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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is the order of requery important?

Status
Not open for further replies.

Steven811

Technical User
Apr 15, 2004
76
GB
Hi

I have form with 4 cascading combo boxes and if you filter down after the form has opened they work fine. If the combo boxes have records and you go back to the 1st combo and choose another record, the 2nd combo correctly shows the selection and the 4th combo is cleared and locked as it should be. However the 3rd combo contains the record set data from the previous selection and has not/doesn't appear to have requeried.

I thought that maybe the requery of the next cbo in the cascade was causing the the problem with the subsequent cbo.

The code that I am using is as follows:

[Private Sub cbo1_AfterUpdate()
Me.cbo2.Requery
Me.cbo2.Locked = Me.cbo2.ListCount < 1
Me.cbo2.Enabled = Me.cbo2.ListCount > 0

Me.cbo3.Requery
Me.cbo3 = ""
Me.cbo3.Locked = Me.cbo3.ListCount < 1
Me.cbo3.Enabled = Me.cbo3.ListCount > 0

Me.cbo4.Requery
Me.cbo4 = ""
Me.cbo4.Locked = Me.cbo4.ListCount < 1
Me.cbo4.Enabled = Me.cbo4.ListCount > 0

End Sub]

Thanks

Steven811
 
Where and how is set the cbo3.RowSource property ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi

It is a query and uses the selection in cbo2 as the criteria.

All of the combo boxes use a query as their source, the last 3 use the previous cbo selection as their criteria.

Thanks for looking.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top