Results 1 to 7 of 7
  1. #1
    miicker is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    18

    Question Email macro does not work proparly

    Hello everyone, I had a DB with an email macro which worked.

    I used the following Macro:
    EMailDataBaseObject
    Object Type: Report
    Object Name: rptInvoice
    Output Format: PDF Format (*.pdf)
    To: =[Reports]![rptInoice]![CEmail]


    Subject: ="Invoice: " & [Reports]![rptInvoice]![InvNr] & " " & [Reports]![rptInvoice]![Date]
    Edit Message: Yes

    This database was created with a Dutch version of Access, I've created another DB, with an English version of Excel, everything is working except for the macro to send an email.

    When I use the following macro:
    EMailDataBaseObject
    Object Type: Report
    Object Name: rptInvoice
    Output Format: PDF Format (*.pdf)
    To:
    Subject:
    Edit Message: Yes
    It works, But I have to fill in the email address, the subject and everything in myself, and I don't want that.

    but when I use:
    EMailDataBaseObject
    Object Type: Report
    Object Name: rptInvoice
    Output Format: PDF Format (*.pdf)
    To: =[Reports]![rptInoice]![CEmail]
    Subject:
    Edit Message: Yes

    I recieve the following error message:
    Click image for larger version. 

Name:	Error1.png 
Views:	10 
Size:	9.8 KB 
ID:	16734

    When I run this macro:
    EMailDataBaseObject
    Object Type: Report
    Object Name: rptInvoice
    Output Format: PDF Format (*.pdf)
    To:
    Subject: ="Invoice: " & [Reports]![rptInvoice]![InvNr] & " " & [Reports]![rptInvoice]![Date]
    Edit Message: Yes

    I get the following error:




    Click image for larger version. 

Name:	Error2.png 
Views:	10 
Size:	4.6 KB 
ID:	16735

    Maybe it's because I use a Dutch way of typing it, I have no idea. Can anyone help me please?

    Kind regards,
    Miicker

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    When you run the Macro is there a report named "rptInvoice" open?

  3. #3
    miicker is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    18
    Yes the report is open when I use the macro (the macro is activated with a buton on that report)

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Try changing
    PDF Format (*.pdf)

    to
    acFormatPDF

  5. #5
    miicker is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    18
    I get the message "invalid value for the Output Format argument"

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    You created db with English version of Excel? Why is Excel involved?

    acFormatPDF is VBA constant. Try VBA event procedure instead of macro.

    The examples show missing 'v' in rptInvoice:
    To: =[Reports]![rptInvoice]![CEmail]
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    miicker is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2013
    Posts
    18
    I'm sorry, I ment Access. But I solved the problem, figured out some fieldnames mismatched.

    Thanks for the help anyway.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Requery macro dont work
    By Lubosh97 in forum Macros
    Replies: 2
    Last Post: 05-06-2014, 08:21 AM
  2. attaching files to an email via a MACRO
    By bobandtom in forum Macros
    Replies: 22
    Last Post: 10-29-2013, 10:25 AM
  3. email PDF filtered form does not work
    By Ruegen in forum Forms
    Replies: 13
    Last Post: 10-13-2013, 09:27 PM
  4. Replies: 1
    Last Post: 05-02-2012, 11:40 AM
  5. 2007 to 2010 macro won't work
    By lmnnt in forum Programming
    Replies: 6
    Last Post: 08-10-2011, 01:55 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums