Try adding parentheses; also, assuming that there is a one-to-one
relationship between Division Names and Division ID's, the ORDER BY is
superfluous.
SQL1 = "SELECT * FROM qryPlayers WHERE Division_Name = '" &
Switchboard.TreeView1.SelectedItem.Text & "' AND (PeopleType = 'Head_Coach'
OR 'Asst_Coach');"
Quote:
>Why do I get all PeopleType records (Players, Cheerleaders and Coaches)
>instead of just the Head_Coach and the Asst_Coach's.
>Is there a way to group the PeopleType criteria?
>Division stuff works fine.
>SQL1 = "SELECT * FROM qryPlayers WHERE Division_Name = '" &
>Switchboard.TreeView1.SelectedItem.Text & "' AND PeopleType = 'Head_Coach'
>OR 'Asst_Coach'" 'ORDER BY DivisionID;"
>Data1.RecordSource = SQL1
>Data1.Refresh
>Thanks in advance
>MEH