Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Need help with some code

Options
  • 08-11-2012 5:20pm
    #1
    Registered Users Posts: 349 ✭✭


    This a long shot I know, but if anyone is handy with a bit of code I really appreicate a bit help.

    Here goes working in Access 2010:
    frmInvoices has a command button which prints a rptInvoice based on [InvoiceNo] the code behind it is:

    If Me.Dirty Then
    Me.Dirty = False
    End If
    Dim strfrmInvoices As String
    Dim strWhere As String
    strfrmInvoices = "rptInvoice"
    strWhere = "[InvoiceNo]=" & Me!InvoiceNo
    DoCmd.OpenReport strfrmInvoices, acPreview, , strWhere

    That's fine when all I want to do is print an invoice. But I would like to be able to email in pdf format sometimes too. So I like a command button to select a report based on [InvoiceNo] save that report as Invoice No[InvoiceNo] & date in PDF format and attach it to an email. It doesn't really matter if the email address is filled out but if possible it would be great.

    Anyone any idea if this is possible and what code I'd need to make it work?
    Thanks in advance


Advertisement