473,516 Members | 3,327 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1735
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
8897
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 Form_frmSingleRegistrant f.Caption = "New Registrant" f.cmdSave.Caption = "&Save New Registrant"
1
2479
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 column is the dvdID but it is hidden just to show the name. Anyway, I use the normal access record navigation arrows to navigate through the dvd's I...
5
2244
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 records in table1. When the user clicks on one of the records, the second list box will show all of the records related to that from table2. Is...
2
2214
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 Columne - Widths 1;0 - LimitToList = Yes Calculated TextBox - ControlSource =cboCustomer.Column(1)
0
1963
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 number of text and combo boxes. This part of the form works fine. On Open a Tab control is displayed but the subforms in each of the three tabs are...
1
1857
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 through the process of connecting to the DB again and filling another temporary DS w/ 1 employee because all the information I need is in the...
1
4684
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 same table the records are inserted into when the page is submitted. I'm wondering if there's a way to requery / refresh the records being...
2
3549
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 id="form1" name="form1" method="POST" action="<%=MM_editAction%>"> <p align="center">
4
4953
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: Mouse, Mickey Mickey Mouse When a person is added, the querys' underlying recordset is updated in the NotInList event. I can't figure out how to...
0
7276
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7182
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7142
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7548
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4773
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3267
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.