467,074 Members | 1,071 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,074 developers. It's quick & easy.

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

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
  • viewed: 1528
Share:
1 Reply
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.

Similar topics

5 posts views Thread by chris vettese | last post: by
2 posts views Thread by Mark Kola | last post: by
1 post views Thread by Omar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.