By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,705 Members | 1,829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,705 IT Pros & Developers. It's quick & easy.

Requerying a list box - but not seeing the updates applied on requery!

P: n/a
MDM
I have a list box control that is bound to a query. The form is not
bound to any source since I have a few list boxes from different
sources. When the form opens the list box is populated correctly.

Now, I have a combo box that contains gender values (male/female).
When the user selects a value from a combo box for the chosen gender,
I want to display only those people of that gender.

To do this, I wrote code in the combo box's (change event). Using a
querydef, I open the query bound to the listbox and change the SQL
property to add a "WHEHE" clause to select only the gender chosen.
The code is executing. But after I requery the list box...the listbox
contents are not updated! I've also tried refresh and
requerying/repainting the form. No luck.

Again - the code is executed but the requery appears to be broken.
Anybody know what the trick is to get a listbox to show the results?
Please help! Thanks, Mike.
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
MDM
mm*******@worldnet.att.net (MDM) wrote in message news:<49**************************@posting.google. com>...
I have a list box control that is bound to a query. The form is not
bound to any source since I have a few list boxes from different
sources. When the form opens the list box is populated correctly.

Now, I have a combo box that contains gender values (male/female).
When the user selects a value from a combo box for the chosen gender,
I want to display only those people of that gender.

To do this, I wrote code in the combo box's (change event). Using a
querydef, I open the query bound to the listbox and change the SQL
property to add a "WHEHE" clause to select only the gender chosen.
The code is executing. But after I requery the list box...the listbox
contents are not updated! I've also tried refresh and
requerying/repainting the form. No luck.

Again - the code is executed but the requery appears to be broken.
Anybody know what the trick is to get a listbox to show the results?
Please help! Thanks, Mike.

I think I discovered a bastardized way of getting the results of the
applied requery displayed...I just added this line:

SendKeys "{F9}"

Apparently F9 will refresh the form and it's controls. There's likely
an easier way to do it but hey - this worked. If you know of a better
(or cleaner) way than please let me know. Thanks!
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.