472,809 Members | 2,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,809 software developers and data experts.

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
1 1706
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Kyralessa | last post by:
In Access 2000, I have a base form with a ListBox of conference registrants. In the form's declarations section I include Dim f as Form To add a registrant I'm doing this: Set f = New...
1
by: Chicken Kebab Abdullah | last post by:
I am making a database of my movie collection and I have a form which Shows a DVD Code in a combo, and a list of the divx movies on the dvd on the right in a list box. The combo boxes bound...
5
by: chris vettese | last post by:
I have a table called table1 that has a one to many relationship to table2. What I would like to do is have a form with two list boxes on it. The first list box will have a field from all of the...
2
by: Mark Kola | last post by:
I have ran into an interesting situation. I have a calculated field based on a combobox column that somtimes is not requerying when I change the combo box value. Combobox cboCustomer 2...
0
by: Jenni | last post by:
I currently have a query that is joining two distinct pools of information and turning them into one records with a unique identifier This query is dependent on criteria passed from a form in a...
1
by: Omar | last post by:
Is it possible to requery a dataset and load the result into a few textboxes? I'm trying to requery a dataset (which contains all employees) so it returns only one employee. I don't want to go...
1
by: planetthoughtful | last post by:
Hi All, I have an ASP.NET page that is used to insert records into an SQL Server table (see previous post). I also have a GridView on the same page that displays the results of a query on the...
2
by: Infopumper | last post by:
:mad: OK. I have been attempting to do this for some time: Dynamic List/Menu Dropdiwn with Usernames Need to update Record Using the Dropdown Using ASP, VB, And Dreamweaver Form Code: <form...
4
by: EManning | last post by:
I have a combobox whose rowsource is a union query. This query displays a person's name in "lastname, firstname" format and in "firstname lastname" format. The query results look like this: ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.