Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2011
    Posts
    30

    Unanswered: Simple SendObject code won't run

    For some reason I cannot get this simple code to run on this command button Can anyone see what I am doing wrong here? The report won't open, send or close. Thanks

    Private Sub cmdconfirm_Click()
    On Error Resume Next

    Select Case Combosection.Value

    Case "Photography 1 - The Basics"

    DoCmd.OpenReport Photo1autoemail, acViewPreview, , "[ID]=" & [TxtID], acWindowNormal
    DoCmd.SendObject acSendReport, Photo1autoemail, acFormatPDF, [Reports].[Photo1autoemail].[textemail], , , "Studio 807 Photography 1 - The Basics Registration Confirmation", "Your registration confirmation is attached. We look forward to seeing you at the Photography 1 - The Basics class!", Yes
    Close Report, Photo1autoemail, No

    Case "Photography 2 - Techniques"

    DoCmd.OpenReport Photo2autoemail, acViewPreview, , "[ID]=" & [TxtID], acWindowNormal
    DoCmd.SendObject acSendReport, Photo2autoemail, acFormatPDF, [Reports].[Photo2autoemail].[textemail], , , "Studio 807 Photography 1 - The Basics Registration Confirmation", "Your registration confirmation is attached. We look forward to seeing you at the Photography 2 - Techniques class!", Yes
    Close Report, Photo2autoemail, No

    End Select
    End Sub

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7
    I would put a stop after the
    rivate Sub cmdconfirm_Click
    Then press f8 this will step run the code
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Apr 2011
    Posts
    30
    what do you mean put a stop? and why would i want to use f8 to get the code to run?

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
  •