Need Help: automating continuous subform

Nizar

Registered User.
Local time
Tomorrow, 00:52
Joined
Oct 21, 2007
Messages
41
Hello,

I want to add a command button to my form that enables me to sort all records on the form into a Word document using mailmerge or automation as a "Purchase Order". This Word document will be saved with the name of the Order, then i will try to add another fonction to send this "purchase order" as an attachement with outlook.
The main problem is that I couldn't merge records on the continuous subform including details about the Order: items, quantity,price....

Please note that I'm a beginner on Access and this is my first project.

Thanks again, any help is highly appreciated,

Best Regards.
 
Last edited:
Well, this kind of project is hardly for "beginners". But the procedure I put in the link I gave u (http://www.access-programmers.co.uk/forums/showthread.php?t=138021) has everything u need to retrieve your recordset data. You only need to create a query which holds just the records you want to pass to the word doc. Sending this like an email attachment could be done like this:

Public Sub SendEmail()
Dim objOutlook As New Outlook.Application
Dim objMessage As MailItem
Set objMessage = objOutlook.CreateItem(olMailItem)
With objMessage
.To = "mysupplier@supplier.com"
.Subject = "Purchase"
.Attachment = "C:\MyPurchase.doc"
.Body = "blablabla"
.Send
End With
End If
Set objOutlook = Nothing
Set objMessage = Nothing
End Sub

This hardcoded example is of limited use, of course, if u want a form on which the user just clicks a few options and presses a final processing button, having everything running effortlessly behind the scenes, pulling all the relevant pieces of data automatically from the different sources. That, I'm afraid, is hardly available anywhere as a total solution for u to just copy: you or someone else will have to develop, debug and implement it piece by piece.

Regards,
Premy
 
Million thanks Premy for your reply and advices,

Best Regards,
 

Users who are viewing this thread

Back
Top Bottom