473,811 Members | 3,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to filter in combo box

4 New Member
hi all! i have two combo box in my program

one has the subteam for example if you click the 1st combo box, the items would be
A1
A2
A3
A4
A5
what i want to happen is that if i chose A1 only the members of team A1 would appear in my combo box2. and by that, you need an sql statement. but how do i code that? can someone help me?
Nov 24 '11 #1
1 2969
pod
298 Contributor
pretty difficult to figure what you need without knowing your database schema

with the assumption your tblplayer has the following fields:
  • playerid
  • playername
  • teamname

then your sql could be
select * from tblplayer where teamname = 1stcombobox

but the above schema would not be following good database design,

a better schema would have three tables:
  1. tableTeams:
    teamid[PK]
    teamname
  2. tablePlayers:
    playerid[PK]
    playername
  3. tableTeamPlayer sAssignement:
    teamid[FK]
    playerid[FK]

where in the tableTeamPlayer sAssignement the two foreign keys can appear more than once in different combinations ...but never twice in the same combination.


I strongly suggest you read on relational database concepts
Nov 29 '11 #2

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

Similar topics

3
4575
by: Mark | last post by:
I have a form that contains the following: 2 radio buttons (Name and Number) 1 check box (for Inactive Members) 1 combo box (list of Member names or numbers) I use the radio buttons to populate the (unbound) combo box with Member names or number depending on which button was clicked. In my database I have a field that shows member status (active or inactive). By defalut my sqlstring that sets the rowsource of the combo box only
1
4792
by: John | last post by:
I have a combo box in a form for ContactName and a combo box with CompanyName. I would like to limit the ConactName combo box to just the names associated with CompanyName. Could someone please help me out with this? Thank you for all of your help.
3
2250
by: Tony | last post by:
Hi, I wonder why when I do a filter by form, some text fields show all the data in the table in the combo box and others only show two items, Is Null and Not Is Null. I want to show all data, instead of just null or not null. I created the text fields the same way. But I don't know if I have changed some properties since and not realized. Thanks, Tony
2
1158
by: Schultzy | last post by:
I think Kazza has the same problem. I am very new at this I also need to get the values from the combo selection and put them in a table I've tried to put the line in the criteria but I don't understand it much =Forms!! What is Forms (Which form do I have to write in here?) What is YourForm (Is this the form where the combo is in?)
3
2876
by: imtmub | last post by:
Hi, I need to filter from one combo box to another in MsExcel. I have two combo box. one is Categary and another is product. If the user select categary depend on that second combo box filter only product which belongs to the categary. I m really sorry i don;t where to post for Excel Question, so i posted here.
2
3899
by: banderson | last post by:
Hello, I have a data entry form for a table with information about buildings and am having a problem making a combo box do what I want. I would like to make the combo box show a list of unique bldg mgmt company names and then to open a building management company form to show all records with this name, so the user can find the correct branch location to select. Then, upon closing the building management company form, the active/selected record...
6
5036
by: banderson | last post by:
Hello, I have a form and a combo box that I use to filter the form to particular records. I also have an "add new" button that, when clicked, adds a new record. My problem is that the filter combo box stays on the old selection when the new record pops up. I would like to have the combo box clear or set to a default value of "New" when the Add New button is clicked or when the user clicks on the * (new record) button in the navigation bar. ...
1
1809
by: karinos57 | last post by:
Hi, I have this form called LOB Selection Tab. I want the user to go to this form and choose from the drop down box any selection he/she wants and then select one of the group options below like: add to existing contract Category unvialble and etc..... So i want a macro or vba code that pulls the data based on the user's selection. The table that has this info is called "MainForm Tab1 Table" Here is summary of what i am trying to say....
18
4153
by: Richard Penfold | last post by:
I have a form with a subform in my database that I use to manage deliveries. A combo box on the subform displays items of inventory and thier current status. The code behind the combo box is... SELECT Inventory.InventoryID, Inventory.ProductCode, Inventory.SerialNumber, .InventoryStatus FROM INNER JOIN Inventory ON .InventoryStatusID = Inventory.InventoryStatusID; A second combo box on the same subform allows me to change the inventory...
0
1397
by: Elaine Huseby | last post by:
I have a form "PartsAndInvoices that has all the parts in the database listed in split form view. I want the user to use Access 2007's filter section on the ribbon to choose mutiple filters. Me.Filter may equal (.="dnr1940"). I tried pass ing me.filter to the report but get all the records in the report not the custom filtered set. Private Sub cmdPartsNInvoiceReport_Click() Dim strFilter As String strFilter = "" If Me.Filter = ""...
0
9726
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9605
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,...
1
10395
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
10130
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9204
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...
0
6887
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5553
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4338
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
2
3865
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.