Results 1 to 4 of 4
  1. #1
    Trace is offline Novice
    Windows 10 Office 365
    Join Date
    Sep 2022
    Posts
    12

    RunTime Error 2487: Object Type argument for action/method blank or invalid??

    Hello and thank you again for all assistance provided in the past! I am slowly getting my database to function in a way that should make my end users happy AND I'm enjoying the process of learning to code (and debug).

    The issue stumping me is this latest error message, which pops up when I click the "Send Email" command button in my Form. On click, the Event Procedure is:

    Code:
     Private Sub Command103_Click()
    
    DoCmd.SendObject acSendReport, rptNewActivityReport, acFormatPDF, 
    Me.cboSupervisor.Value, "(Employee name to be cc'd)", Me.cboEmployee.Value, 
    "NEW EHS ACTIVITY" & Me!ID.Value & "HAS BEEN CREATED" & Date, 
    "THIS IS A TEST EMAIL. A new EHS Activity has been initiated. Please review the Activity and assign an Owner. Click the Notify Owner button when complete. Thank you!",
     True
    The caption for the report is indeed rptNewActivityReport.



    Any suggestions regarding why this is failing?

    Similar code for a command button to send email to an issue owner (assigned later in the process) works just fine, and its code is:

    Code:
     DoCmd.SendObject acSendForm, frmActivityDescription, acFormatPDF, 
    Me.cboOwner.Value, "(Employee name to be cc'ed)",  , 
    "EHS Activity " & Me!ID.Value & " has been assigned to you on " & Date, 
    "Congratulations! An EHS Activity has been assigned to you. Please assign Corrective Actions and a Target Date for this activity.", 
    True

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    The report name would need to be within " "?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Trace is offline Novice
    Windows 10 Office 365
    Join Date
    Sep 2022
    Posts
    12
    It's always the little things, isn't it? THANK YOU!! This fixed the problem.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Be aware that if that was a string variable and it contained the report name, it would have worked.

    That way you can use one command line and set the variables as you did for recipients.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 5
    Last Post: 07-01-2022, 01:53 AM
  2. Runtime Error 3001: Invalid Argument
    By VAer in forum Access
    Replies: 4
    Last Post: 08-30-2018, 04:12 PM
  3. Replies: 1
    Last Post: 09-17-2015, 10:04 PM
  4. Replies: 3
    Last Post: 09-18-2014, 12:24 PM
  5. Replies: 5
    Last Post: 08-05-2009, 04:07 PM

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