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!

adp single record to pdf/word

Status
Not open for further replies.

funkytunaa

Technical User
Oct 9, 2005
116
AU
Ok. This is starting to do my head in.

I am trying to automate a "single" record to a word document.

I can easily do it with an mdb file, but since changing to adp/sql database I am having issues with referencing the forms clientID.

I could probably make a seperate adp front end for each user but that would take time each time a new employee starts etc, what I want is a general front end so I can just copy it across to the new desktops.

A perfect world would be a temp table and merge from that but I don't want a global temp table just a per user one, but I have found that I can't merge from a temp table.

Anyone with any ideas would be GREATLY appreciated.

Now the second part, is it possible to set up text field in a pdf doc and merge to those? or even use a pdf in a word doc. I created a pdf via illustrator and I need to merge into it.....painful to say the least.

Cheers!!!

P.S. If I sound confused and am coming across as such....please ask questions. As I am confused and fairly scattered at this approximate time.


 
Okay - I am confused trying to understand your question.

What do you mean by automating a single record to a word document? Why would it be different per user?

What exactly is this data you are trying to merge and why would it only be temporary?

Maybe with a little clarification someone could help.
 
I'll try an clarify what I want to end up with.

I have a sql backend and an adp front end, anything up to 20 or more users will be connecting to the database, and one of the functions I need is a few buttons on one of the forms that does mailmerges with the current record "only" into a word documents.

I wouldn't have thought it difficult as I have done this in a .mdb database without a hitch, but using sql and adp I found that it doesn't work the same way.

I hope this clarrifies some issues.

Thanks in advance!
C

 
Okkay - there are probably more efficient ways of doing this, but this may still work for you.

Make a report based on a stored procedure representing the current record. Then merge the report with word instead of messing with the code to merge a stored proc or view.

That should work because then the coding is just like it is on an mdb.

Just in case you are unaware - if you have a parameter in the stored proc for the record id, pass it into the report by putting @MyvariableName = Forms!frmName!txtrecordIdname into the input parameters property of the report.
 
I use This code with ofice 2003
Code:
Function ContractMailmerge(ServiceID)
Dim woobj As Word.Application
Set woobj = CreateObject("Word.Application")
With woobj
    .Visible = True
    .Documents.Open "\\xx\xx\xx.dot", , 1
    .ActiveDocument.MailMerge.OpenDataSource "\\xx\xxx\x.odc", , , , , , , , , , , , "Select * from Vcontracts where serviceid=" & ServiceID
    .ActiveDocument.MailMerge.ViewMailMergeFieldCodes = False
    .ActiveDocument.PrintOut
    .Documents.Close 0
    .Quit
End with
end Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top