Using MS Access/access 2007 query if

Advertisement


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

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


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

©2012 About.com, a part of The New York Times Company. All rights reserved.