473,586 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiselect Listbox\Combobo x Issue

114 New Member
Hello,
The details are below, but I have a simple form (Form1) with two objects and a "search" command button. When the two objects are cascading combo boxes (the form creates the parameters for a query - Query1), the query returns my results proper. But when the two objects are cascading combo-then-multiselect listbox (the perferred format in this case), the query always returns zero records.

Tables:
COMPILE (contains the records to be returned), SummaryA (provides record source for SummaryCombo; SummaryID is PK), DetailA (provides record source for DetailCombo; DetailID is PK, SummaryID is FK to table SummaryA)

Query1:
Expand|Select|Wrap|Line Numbers
  1. SELECT COMPILE.Compile_ID, COMPILE.Results_ID, COMPILE.Month, COMPILE.Year, COMPILE.Market_ID, COMPILE.ClientID, COMPILE.ClientName, COMPILE.AE, COMPILE.NAC, COMPILE.SalesPerson, COMPILE.SalesManager, COMPILE.ResponseNo, COMPILE.EmailAddress, COMPILE.Sales_exp, COMPILE.Sales_prof, COMPILE.Sales_ability, COMPILE.Sales_know, COMPILE.Sales_expectations, COMPILE.Sales_contact, COMPILE.AE_exp, COMPILE.AE_effective, COMPILE.AE_know, COMPILE.AE_ability, COMPILE.NAC_exp, COMPILE.NAC_time, COMPILE.NAC_avail, COMPILE.NAC_know, COMPILE.Payroll_accuracy, COMPILE.Client_informed, COMPILE.AE_contact, COMPILE.NAC_contact, COMPILE.Client_conversion, COMPILE.Client_service, COMPILE.Client_satis, COMPILE.Client_recommend, COMPILE.Client_comments
  2. FROM COMPILE
  3. WHERE ((((COMPILE.Sales_exp) LIKE (Forms!Form1!DetailCombo)) Or ((COMPILE.Sales_prof) LIKE (Forms!Form1!DetailCombo)) Or ((COMPILE.Sales_ability) LIKE (Forms!Form1!DetailCombo)) Or ((COMPILE.Sales_know) LIKE (Forms!Form1!DetailCombo)) Or ((COMPILE.Sales_expectations) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.AE_exp) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.AE_effective) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.AE_know) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.AE_ability) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.NAC_exp) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.NAC_time) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.NAC_avail) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.NAC_know) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.Payroll_accuracy) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.Client_conversion) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.Client_service) Like (Forms!Form1!DetailCombo)) Or ((COMPILE.Client_satis) Like (Forms!Form1!DetailCombo))))
  4. ORDER BY COMPILE.Month, COMPILE.Year, COMPILE.Market_ID, COMPILE.ResponseNo;
Form1:
Object1 called "SummaryCom bo"
Object2 called "DetailComb o"
Command button called "ok"
The form's underlying code:
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Private Sub OK_Click()
  3.   Me.Visible = False
  4.   DoCmd.OpenQuery "Query1", acViewNormal, acEdit
  5.   DoCmd.close acForm, "Form1"
  6. End Sub
  7. Private Sub Cancel_Click()
  8.   DoCmd.close 'Close Form
  9. End Sub
  10. Private Sub SummaryCombo_AfterUpdate()
  11.   With Me![DetailCombo]
  12.     If IsNull(Me!SummaryCombo) Then
  13.       .RowSource = ""
  14.     Else
  15.       .RowSource = "SELECT [Response] " & _
  16.                    "FROM DetailA " & _
  17.                    "WHERE [SummaryID]=" & Me!SummaryCombo
  18.     End If
  19.     Call .Requery
  20.   End With
  21.  End Sub
  22.  
I've searched throughout the posts and articles but can find a solution that I easily understand; any takers on why my multiselect listbox doesn't return values but the combobox does? Thanks.
Oct 8 '07 #1
5 4238
missinglinq
3,532 Recognized Expert Specialist
Just to be sure, you replaced the second combobox with a multi-select listbox, and named the listbox DetailCombo?

Linq ;)>
Oct 8 '07 #2
martin DH
114 New Member
Just to be sure, you replaced the second combobox with a multi-select listbox, and named the listbox DetailCombo?

Linq ;)>
Good point to clarify - yes I did. SummaryCombo is a combobox and DetailCombo is a multiselect listbox (I apologize for the poor naming standard!).
Oct 8 '07 #3
nico5038
3,080 Recognized Expert Specialist
Hmm, you would need code to transform the selected entries from the mulitselect listbox into an IN() clause.

Personally I prefer to offer a user a datasheet subform with checkboxes (YesNo field) to be more "stable" when selecting the needed rows. Besides the more stable way of selection this offers me the opportunity to JOIN this table with the maintable and filter for the YesNo field to be True. Thus no code is needed.

In your case that could imply to create a temp table for the datasheet subform and fill that after the selection of the "master" combo.

Getting the idea ?

Nic;o)
Oct 8 '07 #4
martin DH
114 New Member
Hmm, you would need code to transform the selected entries from the mulitselect listbox into an IN() clause.

Personally I prefer to offer a user a datasheet subform with checkboxes (YesNo field) to be more "stable" when selecting the needed rows. Besides the more stable way of selection this offers me the opportunity to JOIN this table with the maintable and filter for the YesNo field to be True. Thus no code is needed.

In your case that could imply to create a temp table for the datasheet subform and fill that after the selection of the "master" combo.

Getting the idea ?

Nic;o)
No, I'm afraid I'm not - when it comes to subforms I really have no experience. Using checkboxes would work better I believe but I'm worried about writing my query...perhaps with some help.... With checkboxes, I could actually eliminate the need for the cascading combo boxes altogether.

The database is for reporting on the results of surveys. Customers have responded with 1 of 5 different answer possibilities to several questions (as you can see by my query SQL above). The users must be able to look at any combination of the selected answer possibilities. I've done this sort of thing before (http://www.thescripts.com/forum/thread708234.html) but never with this many fields and answer possibilities.

Based on the thread above, should I just go about it that way, even though my SQL will be quite long, or is there a hint of a shorter method?

Thank you!
Oct 9 '07 #5
nico5038
3,080 Recognized Expert Specialist
Rereading your present query, I must admit I'm not able to see the link between the cascading combo and multiselect listbox.
It's not clear to me how you use these two formobjects regarding the use in the query. It looks like you want to filter on each field of your table, and in the table (or a (datasheet sub)-form) you can use a simple right-click to perform such a filtering using the popup menu.
I always give my users the following description to allow them to sort and filter as they like:
http://www.geocities.com/nico5038/xR...nstruction.zip

Nic;o)
Oct 9 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
6354
by: Jon McLean | last post by:
I fear that my question may be elementary, but what I am trying just is not working. I have two tables: tblContacts (Essentially a mailing list. Each contact has an Autonumber ID.) tblContactIssues (Just an issue ID as long integer and ContactID as long integer to correspond with tblContacts. I want to capture multiple issues of...
2
3347
by: Cassie Pennington | last post by:
I am trying to write various items from a multiselect list box to an SQL statement to update a report, without success. SQL only appears to accept hard-coded data or control values from a form, not variable data. Any clues as to how I can write several items to an SQL statement from a multiselect listbox to update a report? Thanks in...
1
1978
by: tod4 | last post by:
Hi, My problem: I have query with value klient and product. On my form Im using multiselect box as filter of klient value. Now I would like to use second multiselect on this form for product value selection but only for those value that are filtered by first multiselect. I dont know how to connect selected value klient from first...
0
1400
by: BuddyWork | last post by:
Hello, When switching the MultiSelect to true, and then you start selecting a row it de-selects the previous selected row, if I hold the CTL or SHIFT key then it keeps the previous selection. I want to be able to just click on the row and for it to select/deselect depending if already selected. Can you let me know if this can be done, and...
6
1703
by: ¿ Mahesh Kumar | last post by:
Hi groups, Control name : ListboxID (lstCertification), selection mode=mutliselect. On Pageload i'm assinging string lstSplit="1/3/6/8" of the previously selected listindex id's. Now on the page load for updation, i have to reload the selected items again with the same string "1/3/6/8" to be selected in my multiselect list box. Its...
0
296
by: Robert | last post by:
Hi, I have a program with a ListView (with Multiselect) and am using the SelectedIndexChanged handler. However, when the index is changed, a rather long set of events occurs which takes quite some time. Therefore, if the user tries to multiselect several items (holding down Shift), it takes that many times longer. Is there a way to only...
2
1948
by: Steph | last post by:
I have created a multiselect list box control (lbx_comorb) that is populated from a datatable (dt_ptAdmission). The list box populates now problem at all. However the issue is when I load the webform, when there is already admission data. I need the populated list box (lbx_comorb) to show the items that were previously selected for this...
1
3181
by: IMK | last post by:
Hello all, Sorry if this issue has come up already but I am new to vb.net. Thanks. I am trying to retrieve the selectedvalues from a multiselect list box in a vb 2005 winform. Here is the code I am using so far: dim i as object For Each i In Me.lstUnitPicklist.SelectedItems
0
7841
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...
0
8204
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. ...
0
8339
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...
1
7965
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
8220
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
5712
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
3838
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
3869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
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

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.