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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IT's A Challenge (for Tough Brains)

Status
Not open for further replies.

manjeetsingh

Programmer
Jul 9, 2002
6
IN
i am writing a mail merge program.problem,is
i want to sort the datasource,based on a field like
(CompanyName) and then there should be a option where
i could make a merged file containing companynames in a sorted order and between some range.
like companyname starting with 'A' to Companyname starting
with 'J' , CompanyName starting with 'K' to companyName
starting with 'Z' and so on.
Please help.

this is the datasource code i am using
--
objWord.MailMerge.OpenDataSource _
Name:="" & strDataSource & "", _
LinkToSource:=True, _
Connection:="TABLE " & strTableName & "", _
SQLStatement:="Select * from [" & strTableName & "] "

 
Not that difficult. You need to add a WHERE clause that's all. Look up WHERE in help related to sql statements. Peter Meachem
peter@accuflight.com

 
Not that difficult. You need to add a WHERE clause that's all. Look up WHERE in help related to sql statements. Peter Meachem
peter@accuflight.com

 
dear peter ,thanks alot.
i had already tested that.
But both OrderBy and Where clauses are not working in the
SQLStatement specified in the OpenDataSource statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top