Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mass emails by selection 1

Status
Not open for further replies.

jmc014

Technical User
Nov 24, 2007
80
ES
Hi,

Can someone help me add another condition to the below selection:

Dim Re As DAO.Recordset

Set Re = CurrentDb.OpenRecordset("Select * From Tel_List Where Email_1 Is not null")


The intention is to select all those [Email_1] Fields as well as a company category, for expample [Forms]![My_Form]![Category]

I'm not at very good at writing code, here's what I've been trying:

Set Re = CurrentDb.OpenRecordset("Select * From Tel_List Where Email_1 Is not null" & ("Select * From Tel_List Where Category = [Forms]![My_Form]![Category]"))

Any help would be highly appreciated.
Best regards,

P.D. HAPPY CHRISTMAS TO EVERYONE
 
Code:
Set Re = CurrentDb.OpenRecordset("SELECT * FROM Tel_List WHERE Email_1 Is Not Null AND Category='" & Forms!My_Form!Category & "'")
If Category is defined as numeric then get rid of the single quotes.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,

Thank you very much, you help is appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top