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

requery listbox automatically

Status
Not open for further replies.
Jan 14, 2002
143
0
0
US
Howdy,

I want to requery a listbox when the user clicks over to the tab it's located on. Seems simple enough but the On Click event for the tab doesn't work for some reason with a listbox.requery (and there isn't a got focus for a tab control)

I'm currently using the After Update event in the form records are being updated on another tab, but don't want to requery the listbox after each update anymore for performance reasons

How can I get my listbox to requery when that tab gets the focus?

Thanks

 
I believe re-setting the ListBox RowSource would force it to renew.

me.listbox.rowsource = "SELECT * FROM MyTable;"


or the like.

rollie@bwsys.net
 
You could try putting the Requery in the OnGotFocus event of the tab.

[shadeshappy] Cruising the Information Superhighway
[sub] (your mileage may vary)[/sub]
 
me.mylistbox.requery will force your list to, well, requery ;)
 
Ok, one more time:

Wemeier, tabs controls do not have a Got Focus

Keph, I'm already using mylistbox.requery BUT IT DOESN'T EVER WORK FOR THE ON CLICK EVENT OF THE TAB.


questions are not always as they seem on the surface, especially if you're just looking at the subject! I suggest reading them fully before responding to them.





 
Aren't we trowing temper tentrum here ?
Beware! Experts are very sensitive material, and if you have others to ask - you may as well do that.

What to your problem - I am bataling ListBox on my own.
Have you tried Visible property ?
Let me know if it was correct, OK ?

TIA
 
Okayyyy, one more time.

Try using the OnChange property. It will execute EVERY time the user changes tabs, but it may still be better than after every time the user updates a record.

By the way, the OnClick event WILL work when you change pages, but only when you click on the Detail Section of the page, not the tab that identifies the page.

[shadeshappy] Cruising the Information Superhighway
[sub] (your mileage may vary)[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top