dbTalk Databases Forums  

Re: Basic Query

comp.database.ms-access comp.database.ms-access


Discuss Re: Basic Query in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Simonc
 
Posts: n/a

Default Re: Basic Query - 07-27-2003 , 10:59 AM






I don't know if this is any use to you, but could you not create a
form based on TeamTable that concatonated ID and TeamName in a list
box, and then put in a subform that showed all records from Membership
Table based on the selection from the list box? You could probably use
an SQL or a wizard to fill the subform. Sorry if you've tried this
already...

acrocker (AT) lineone (DOT) net (Crox) wrote in message news:<3e3cced5.0307151325.6073a8aa (AT) posting (DOT) google.com>...
Quote:
I am building a simple database structure to assist in the
administration of a football club. My need is one of creating an adhoc
query of the main membership table through a reference from another
table. A simplified example:-

Membership Table
001 (Key)
002 (Name)
003 (Key of TeamName)

Team Table
001 (Key)
002 (TeamName)

What I want to do is create a query that displays a complete list of
TeamNames (from the Team Table) from which I can select one. Selection
will then search the Membership Table and present a report displaying
the Name of all players who are members of the selected team.

I have searched the access help, microsoft examples and resources and
the archives but have been unable to find an answer.

Please help.

Reply With Quote
  #2  
Old   
bala
 
Posts: n/a

Default Re: Basic Query - 07-31-2003 , 01:14 PM






hi!!!

assuming u have a combobox populated with team names from team table

the rowsource of the combobox would be

Select key, TeamName from Team.

the combobox will be having two columns. the first one will have the
key and the second column will have the coressponding Team name. the
first column can be made invisible so when u click on the combobox
only the team name will be visible.

on the click even of the combobox

build a query obtaining the key of team table from the team name
selected in the combobox.

dim iTeamKey as integer 'for storing the key of the team name
selected

iTeamKey = <combobox>.value
Select Name from Membership where Membership.Key = " & iTeamKey &
"

set this query as the source for the subform (assuming the u have form
which the combobox and also a subform to display the team members of
the team selected.

if u wanna populate the members name in another combobox please make
the above query as rowsource of this combobox.

thanx hope this helps, take care and be safe

regards
bala

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.