Creating a list of mailouts

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

Guest

Hello.

I have two tables called Mailouts and Customers. I have a lookup table
between them containing foreign keys from both tables. What I'd like to do is
do a search for customers by certain criteria, then create a new mailing
where it would create a new Mailout_ID, and then it would create new rows,
each with that Mailout_ID plus all the Customer_IDs that were returned in the
search.

Would this require a macro? I'm not really sure.

Thanks
Andrew
 
You best approach would be to use a query

Lets say your 'customers' table is something like

CustomerID | CustomerName | CustomerAddress | LikesBooks | LikesFilm
| LikesIcecrea

You want to select the name and address of everyone who likes film
(which is indicated by a tick box in he 'LikesFilms' field, the SQ
query to select all this would be

SELECT CustomerName, CustomerAddress FROM Customers WHERE LikesFilms
Ye

That's the most basic type of select query, it would list the name an
address of every customer who meets the criteria

You can expand on the criteria... maybe

SELECT CustomerName, CustomerAddress FROM Customers WHERE LikesFilms
Yes AND LikesBooks = Yes AND LikesIcecream = N

That'd just select the customers who met all three criteria (though
doubt there'll be many who don't like ice cream) - you can also us
OR in the same way

WHERE LikesFilms = Yes OR LikesBooks = Ye

And so forth..

There's a few different approaches to inserting a new row but m
personal choice is to use SQL again, it will depend on the structur
of your table and where you're getting the data from but a search fo
SQL INSERT on Google should give you a good starting point
 
Back
Top