access --> word with mail merge (1 Viewer)

Sleekmac

Registered User.
Local time
Today, 15:20
Joined
Sep 25, 2006
Messages
34
Hello all! I'm working on a project that integrates an Access database with several Word "templates" via mail merge. I've worked most of the kinks out, but I have a few loose ends that I was hoping someone would be able to assist with please?

Right now, there is a form in access with 9 command buttons on it. Each OnClick event is linked to the same function, with a different string argument. The function contains a select case loop that determines which file to open, and which datasource. The mail merge executes, prints, and then Word quits. This all works.
However, I need to put in a statement that closes the data source. The reason is, it all executes fine the first time, but if I try to run the function again without first closing the entire access database, it asks all kinds of wierd questions about the data source. (I think the problem behind that is, it is trying to activate a second datasource while the first is still open.) I cannot find any commands to close an open data source.
My second problem is, when the function prints (after the mailmerge occurs), I need to print it to a specific printer. (NOT the default printer.) These merged documents contain embedded rightfax codes to go straight through to a fax#, and therefore the files must be printed to the embedded rightfax driver. It's not reasonable to have the users change their default printer to that driver because they print other files to an actual printer. I've checked every possible method/argument on the doc.Printout function, and I do not see the capability to choose a printer to print to by name. Any ideas on that?

Thanks in advance!
Don
 

Sleekmac

Registered User.
Local time
Today, 15:20
Joined
Sep 25, 2006
Messages
34
Brilliant Answers

Issue #1 - set {openconnection} = Nothing

Issue #2 - {openconnection}.ActivePrinter = "\\inxfax01\HPFAX"


Thanks Sleekmac for answering your own question! Great job. :)
 

Users who are viewing this thread

Top Bottom