Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Need help with some code

  • 08-11-2012 05:20PM
    #1
    Registered Users, Registered Users 2 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