Clean combos

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello!

In one form I have 5 sequential combos: cbo1 to cbo5
If I needing in cbo4 to return to cbo2 to change option, the contents of the
combos 3 and 4, they are not refreshed, disabling one correct update of 3rd
and 4th combos.
I would like to clean next combo data when return to previous combo.

Already tried Me.cbo3.requery and Me.cbo4.requery in previous combos but did
not result.
As I can tilt this difficulty, please

Anticipatedly been thankful.
an
 
In addition to the Requery, try setting the combo = Null to clear its
textbox.

Me.cbo3 = Null
 
WM,
Thanks for your reply.

Already clean the content of following combo .
However, now, it doesn't present the possible data in function of the new
choice.
Thanks.
an
 
Where are you issuing the Requery command? It should be in the AfterUpdate
event of the previous combos.
 
WM,
Thanks for your reply.

Any "nuance" must have that it is to hinder to function well the code.
Perhaps for having one textbox to open cbo's...
I have the freedom of the to place to follow code (of the 3th Cbo)

Private Sub txtConc1_DblClick(Cancel As Integer)

Me.txtConc1 = "" ' in front of cboConc to click
Me.txtConc2 = "*" ' to assist and hidden
Me.cboConc = ""
Me.cboConc.Visible = True
Me.cboConc.SetFocus
Me.txtConc1.Visible = False

' next combo
Me.txtTipAlv1.Requery
Me.cboTipAlv.Requery

'List box with result after chosse options in 5 combos
Me.ListGer.Requery

End Sub
___________________________________________________

Private Sub cboConc_AfterUpdate()

Me.txtConc1 = Me.cboConc
Me.txtConc2 = Me.cboConc
Me.txtConc1.Visible = True
Me.txtConc1.SetFocus
Me.cboConc.Visible = False
Me.cboConc = ""

Me.txtTipAlv1.Requery
Me.cboTipAlv.Requery

Me.ListGer.Requery

EndSub
____________________________________________________

Private Sub cboConc_GotFocus()

Me.cboConc.Dropdown
Me.txtTipAlvo1.Requery
Me.cboTipAlvo.Requery

Me.ListGer.Requery

End Sub

Finnaly, if I clicck two times in txtConc1, work fine.But only in 2nd time (?)

been thankful
an
 
An,

I'm having a hard time following what exactly you're asking. If you want one
combo box's values in the drop down to be filtered by the values selected in
the combo boxes you've already made selections in, you need to add a WHERE
clause to this combo box that will limit its RowSource by the values
selected in the other combo boxes (see reply to your other message). You
would then requery this combo box in the AfterUpdate event of the earlier
combo box or boxes. By doing the requery in the AfterUpdate event, you're
telling this combo box that the other combo box has changed and that it
needs to refilter its RowSource.
 
WM,
thank you for your explanation.
an

Wayne Morgan said:
An,

I'm having a hard time following what exactly you're asking. If you want one
combo box's values in the drop down to be filtered by the values selected in
the combo boxes you've already made selections in, you need to add a WHERE
clause to this combo box that will limit its RowSource by the values
selected in the other combo boxes (see reply to your other message). You
would then requery this combo box in the AfterUpdate event of the earlier
combo box or boxes. By doing the requery in the AfterUpdate event, you're
telling this combo box that the other combo box has changed and that it
needs to refilter its RowSource.
 

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

Back
Top