query to get mailing list

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have built a database where users for mailing groups are identified by the
appropriate button on the entry form. I then built a seperate table which
holds the details of the groups so that they can be picked out using a combo
on a selection form ready for label printing.

The query I used is

SELECT PEOPLE.TITLE, PEOPLE.FORENAME, PEOPLE.SURNAME, PEOPLE.DEPARTMENT,
PEOPLE.ADD0, PEOPLE.ADD1, PEOPLE.ADD2, PEOPLE.ADD3, PEOPLE.ADD4,
PEOPLE.POSTCODE
FROM PEOPLE
WHERE ((([Forms]![groupselector]![selector])=True));

where the [Forms]![groupselector]![selector]) part returns the name of the
"yes/no"field eg AS.

The query works ok if I replace the [Forms]![groupselector]![selector])
part with just AS - ie it returns only members of that group

Can anyone please help!!!!
 
OK, as an example I'll assume you have 3 Yes/No fields called A,B and C.

On your form, I'm assuming your "selector" is a combo box which has a value
list of your yes/no field names. Amend this combo so that it has 2 columns
and give each of your fields a number:-
RowSource = 1,"A",2,"B",3,"C"
ColumnCount = 2
ColumnWidths = 0,4

Then amend your query as follows:-

SELECT * FROM PEOPLE
WHERE Choose([Forms]![groupselector]![selector],[A],,[C])=TRUE


hth

Chris
 

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

Back
Top