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

one combobox linked to multiple listboxes in different tabs

Status
Not open for further replies.

ben1977

Technical User
Jul 25, 2011
6
CH
Hi,

I have one form with an unbound combobox.
If I now move between different tabs which are listed on that form,
I always have to "refresh" the combobox, even the client name in the combobox is always visible to get the correct result in the listbox.

Also when I change something in the listbox, I always have to "refresh" the combobox, so that the changes are visible in the listbox. I try to set a click event on the different tabs

Me.combobox_client.Requery
Me.Listbox1.Requery

But that doesn't helps. I think there should be an easier way instead of clicking always on the same client which is already visible in the combobox.

thank you very much
Ben
 
You need an event to trigger the requries try on the on change event of the tab control
 
Hi PWise

Thanks for your input, but there is no change event on the tab control. I try to do the requery onclick, but without success :-(
 
I saw that the onchange event is on the register itself, but if set following code:

Me.ListA.Requery


Nothing happens, I think the combobox on the form needs having a refresh, because when I just click on the same name in the combobox the listbox changes to correct values. ???

How can I insert a code which always refresh the combobox when I move to another tab, to be sure that there is always the correct values listed?

I really have troubles with those comboboxes because there is also one other threat pending with comboboxes....
 
How are ya ben1977 . . .

You need to explain [blue]what you want to happen![/blue]

Also ... post the [blue]RowSource[/blue] of the combo and a few of the listboxes. If any are query, post the SQL.
[ol][li]Is the form bound?[/li]
[li]Where does the combobox reside on the form?[/li]
[li]Are the listboxes on subforms?[/li]
[li]How are you linking combo/list boxes?[/li][/ol]
Note: [blue]Requery[/blue] resets a combobox by re-running the rowsource, clearing all selections and clearing the textbox portion.

Note: [blue]Requery[/blue] doesn't work on a listbox. Use the following instead:
Code:
[blue]   Me.[purple][B][I]ListboxName[/I][/B][/purple].RowSource = Me.[purple][B][I]ListboxName[/I][/B][/purple].RowSource[/blue]
The effect is the same as requery for a combobox.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top