473,616 Members | 2,835 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 1741
MDM
mm*******@world net.att.net (MDM) wrote in message news:<49******* *************** ****@posting.go ogle.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
8902
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
2486
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 have and the combo box updates accordingly to a new dvd and as it does this I want it to requery my...
5
2249
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 this possible? How can it be done. Regards, Chris Vettese
2
2226
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
1969
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 hidden until the required info is gathered from the user. The subforms are then displayed,...
1
1870
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 previously populated DS. Thanks.
1
4691
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 displayed by the GridView when the page is submitted?
2
3555
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
4962
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 refresh the combobox to display the new person. I get the standard error message that the
0
8145
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8642
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8592
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8294
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7118
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6097
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4140
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2576
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
0
1439
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.