473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

how to filter in combo box

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 2946
pod
298 100+
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. tableTeamPlayersAssignement:
    teamid[FK]
    playerid[FK]

where in the tableTeamPlayersAssignement 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
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...
1
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...
3
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,...
2
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...
3
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...
2
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...
6
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...
1
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:...
18
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......
0
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....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...

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.