Combo Boxes

G

Guest

Wonder if anyone has a possible solution to my problem. I am working on a
bowling database and essentially it manages bowling leagues. I have main form
that displays the different league one might want to manage, as you scroll
through each league, you can then view/create schedules for each week. IE
which team is playing which team. My problem comes when I select a team from
the combox box which is in a subform. I only want to be able to see the teams
that are in that league, not ALL of the teams in the database. How can I work
it so that my combo box will only display those teams that are in the league
that is selected in the main form, similary once I have solved this problem
it should enable to solve the problem of only displaying only those bowlers
that are enrolled for a specific team via a combo box and not display all of
the bowlers in the database

Any help would be gratfully received

Kind Regards

Peter
 
K

Ken Snell [MVP]

You likely can filter the Row Source query that is used for this combo box
by using the control on the main form that contains the league ID value:

SELECT TeamName FROM TableName Where LeagueID =
Forms!MainFormName!ControlWithLeagueIDvalue
 
G

Guest

OK Thanks for that I have entered the following SQL:

SELECT tblTeamName.TeamID, tblTeamName.TeamName
FROM tblTeamName
WHERE (((tblTeamName.LeagueID)=[Forms]![frmLeague]![LeagueID]))
ORDER BY tblTeamName.TeamName;

It gives me the following error:

Enter Parameter Value
Forms!frmLeague!LeagueID

Have you any idea whatthis means, although when I enter the league ID in the
input box it does work! I'm halfway therebut it would be great if I didn't
have to enter the league ID myself

Kind Regards

Peter
 
K

Ken Snell [MVP]

It means
(1) there is no form named frmLeague open at the time the query runs;
(2) there is no control named LeagueID on the form frmLeague.

--

Ken Snell
<MS ACCESS MVP>

PDUK1 said:
OK Thanks for that I have entered the following SQL:

SELECT tblTeamName.TeamID, tblTeamName.TeamName
FROM tblTeamName
WHERE (((tblTeamName.LeagueID)=[Forms]![frmLeague]![LeagueID]))
ORDER BY tblTeamName.TeamName;

It gives me the following error:

Enter Parameter Value
Forms!frmLeague!LeagueID

Have you any idea whatthis means, although when I enter the league ID in the
input box it does work! I'm halfway therebut it would be great if I didn't
have to enter the league ID myself

Kind Regards

Peter


Ken Snell said:
You likely can filter the Row Source query that is used for this combo box
by using the control on the main form that contains the league ID value:

SELECT TeamName FROM TableName Where LeagueID =
Forms!MainFormName!ControlWithLeagueIDvalue

--

Ken Snell
<MS ACCESS MVP>

main
form team
from the
teams I
work all
of
 
G

Guest

Thank you Ken. Have managed to get it to work - will now try and implement it
It means
(1) there is no form named frmLeague open at the time the query runs;
(2) there is no control named LeagueID on the form frmLeague.

--

Ken Snell
<MS ACCESS MVP>

PDUK1 said:
OK Thanks for that I have entered the following SQL:

SELECT tblTeamName.TeamID, tblTeamName.TeamName
FROM tblTeamName
WHERE (((tblTeamName.LeagueID)=[Forms]![frmLeague]![LeagueID]))
ORDER BY tblTeamName.TeamName;

It gives me the following error:

Enter Parameter Value
Forms!frmLeague!LeagueID

Have you any idea whatthis means, although when I enter the league ID in the
input box it does work! I'm halfway therebut it would be great if I didn't
have to enter the league ID myself

Kind Regards

Peter


Ken Snell said:
You likely can filter the Row Source query that is used for this combo box
by using the control on the main form that contains the league ID value:

SELECT TeamName FROM TableName Where LeagueID =
Forms!MainFormName!ControlWithLeagueIDvalue

--

Ken Snell
<MS ACCESS MVP>

Wonder if anyone has a possible solution to my problem. I am working on a
bowling database and essentially it manages bowling leagues. I have main
form
that displays the different league one might want to manage, as you scroll
through each league, you can then view/create schedules for each week. IE
which team is playing which team. My problem comes when I select a team
from
the combox box which is in a subform. I only want to be able to see the
teams
that are in that league, not ALL of the teams in the database. How can I
work
it so that my combo box will only display those teams that are in the
league
that is selected in the main form, similary once I have solved this
problem
it should enable to solve the problem of only displaying only those
bowlers
that are enrolled for a specific team via a combo box and not display all
of
the bowlers in the database

Any help would be gratfully received

Kind Regards

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top