View Single Post
 
Old 04-03-2016, 07:41 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by JennEx View Post
With:
Code:
StrSQL = "SELECT * FROM [CORE$]
Word just kept opening mail merge documents over and over, mergiing without headers and footers and reports of 135 calculation errors (there are only 31 records in my database). I had to <CTRL><ALT><DEL> to end Excel to stop the Word reports from being created non stop.
I can't see how it's possible for the 'over and over' to occur, as there's no looping in the code - just a single merge to a new file. All you should have ended up with is a single file with outputs for your 31 records. Did you just run the macro on its own, or did you call it from another one? The lack of separate headers and footers is because you're doing a Directory merge, which has only a single Section and hence, a single header & footer.
Quote:
Originally Posted by JennEx View Post
With just:
Code:
StrSQL = "SELECT * FROM [CORE$] " & _
              "ORDER BY [START] ASC, [COMPLEX] ASC, [UNIT] ASC"
Received the mysterious select table prompt with the DATA1.xls worksheet.
Evidently, then, there's a problem with this part of the SQL:
"ORDER BY [START] ASC, [COMPLEX] ASC, [UNIT] ASC"
Do the START, COMPLEX & UNIT fields you're trying to order by exist in the data source (Aug-30 (Sun) schedule_3.xlsx)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote