AllExperts > Using MS Access 
Search      
Using MS Access
Volunteer
Answers to thousands of questions
 Home · More Using MS Access Questions · Answer Library  · Encyclopedia ·
More Using MS Access Answers
Question Library

Ask a question about Using MS Access
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Scottgem
Expertise
I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience
I've been designing databases for over 15 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

 
   

You are here:  Experts > Computing/Technology > Business Software > Using MS Access > access 2007 query if

Using MS Access - access 2007 query if


Expert: Scottgem - 7/3/2009

Question
Dear  scott
I'm designing a form using access 2007, in this form I have a page which has  two drop down lists the first one is  groups names, and the second is the members of the groups  the question is how to make  the members of each group in the second  appear according to the group name in the first? where I have a table which its fields are  group 1 names,  group 2 names …..etc  each field contains the specific group members.
I did sth. Like that, query on the table has the statements criteria for each field but it returns no thing in the form  
"field return:(iif([forms]![apform]![mebers field]=[group 1 names])"
"field return:(iif([forms]![apform]![mebers field]=[group 2 names])"
.
.
             Sorry if It's not clear or  long question
Thanks in advance


Answer
This is actually a standard technique called cascading or synchronized comboboxes. This article:
http://support.microsoft.com/kb/289670
explains how to do them.

Two points. You really should have three tables here:

tblGroup
GroupID (Primary Key Autonumber)
GroupName

tblMember
MemberID (PK autonumber)
FirstName
Lastname

tblGroupMember
GroupID (Foreign Key)
MemberID (FK)

The third table may not be necessary if a member can only belong to ONE group. If that's the case, then GroupID becomes a FK in tblMember.

Hope this helps,
Scott<>
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.