Page 3 of 5 FirstFirst 12345 LastLast
Results 31 to 45 of 66
  1. #31
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    Hi Paul,

    I just removed the embedded macro. Now where do I put the code? under the Invoice Report or the Order Details?

  2. #32
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You put the code where you want the process to happen. That sounded like the double-click event of the email textbox.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #33
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Sorry, I was rushing, yes I forgot to enter quantity.

    Yes, the DblClick event property of email textbox showed [Embedded Macro] instead of [Event Procedure]. There was no VBA code.
    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.

  4. #34
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    Paul,

    I put the code in OrderDetail in the under Events DblClick where the email address is under the Customer Name.

    Tried it out..this is what happened:

    After Double Clicking where the email address is one piece of good news is that it brings up JUST that one invoice for that customer. Now here is the issues

    1. It didnt put the email address in the email
    2. When "X" out in the upper right hand corner of the email received error (see next)
    Click image for larger version. 

Name:	SendObect Debug.png 
Views:	3 
Size:	22.2 KB 
ID:	12061

    Clicked on Debug and saw this..
    Click image for larger version. 

Name:	Debug Report.jpg 
Views:	3 
Size:	98.6 KB 
ID:	12062

    I backed out of the debug and stopped it after I went and added what I thought from previous code recieved
    DoCmd.OpenReport "Invoice", acViewNormal, , "[Invoice ID]=" & Me![Order ID]
    DoCmd.SendObject acSendReport, , acFormatPDF, "email address", , , "Invoice", "email body text"


    And the line was still yellow and I backed out of the debugging but saved this code and the form..

    Tried it again and this time in where the email address is suppose to me it just said "email address" (slapping my forehead thinking of course its going to say that cuz the code said to say that dohhh)

    But then something else happened..

    I "X" out of the email..got the same errors/debugging info again..but this time when I just backed out of it this is what happened

    Click image for larger version. 

Name:	SendObject Error.png 
Views:	5 
Size:	43.3 KB 
ID:	12063
    to which when I closed out of this now froze my Access to which I had to use Cntl/Alt/Del in Task Manager to End the program

    I am only going to be here at work for another 2 hours then I am gone until Monday. I would love to get this fixed before I leave for the weekend..

    You both have been great and again thank you for your patience for my stupidity

    Stephanie

  5. #35
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Closing the email without sending will trigger that. You handle it with an error trap:

    http://www.baldyweb.com/ErrorTrap.htm

    In your case you probably want to simply take the message box out for that particular error number (2501 if memory serves).
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #36
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Instead of "email address" need to reference the textbox on form as noted in post 16.
    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. #37
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    Ok now I just copied and pasted that code here that you have on that page..here is my questions in RED:

    Private Sub E_mail_Address_DblClick(Cancel As Integer) <--Correct?
    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    On Error GoTo ErrorHandler

    DoCmd.OpenReport "Invoice", acViewPreview, , "[Order ID]=" & Me![Order ID]
    DoCmd.SendObject acSendReport, , acFormatPDF, , "email address", , , "Invoice", "email body text", True <---Correct?

    ExitHandler:
    Set rs = Nothing
    Set db = Nothing
    Exit Sub
    ErrorHandler:
    Select Case Err 'specific Case statements for errors we can anticipate, the "Else" catches any others <---What do you mean?
    Case 2501
    MsgBox "No data to display"
    DoCmd.Hourglass False
    Resume ExitHandler
    Case Else
    MsgBox Err.Description
    DoCmd.Hourglass False
    Resume ExitHandler
    End Select

    End Sub

    If this is all correct above (besides taking out the "email address") then how can I get it to recognized the email address and put it where it belongs? (I will be putting a standard email body text later)

    I remembered that was what the Macro did for me instead ..and now that is gone in place of doing this way

    Stephanie

  8. #38
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Take this line out:

    MsgBox "No data to display"

    and change this to point to the address, using whatever the actual name is:

    DoCmd.SendObject acSendReport, , acFormatPDF, , Me.EmailAddress, , , "Invoice", "email body text", True


    As to the header line, I'd leave it as Access created.

    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #39
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Change "email address" to reference the email textbox: Me.[E-mail Address]


    Advise no spaces or special characters/punctuation (underscore is exception) in names. I am not sure if the field/textbox names have a hyphen but that is what I see in the image you posted although the procedure declaration does not show hyphen. Use either name with correct spelling.


    Put whatever you want in place of "email body text".
    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.

  10. #40
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    Ok now getting another error and no email popup or even the invoice popup

    Click image for larger version. 

Name:	syntax error.png 
Views:	3 
Size:	15.6 KB 
ID:	12064

    Click image for larger version. 

Name:	Debug Report2.jpg 
Views:	5 
Size:	105.0 KB 
ID:	12065

    Ok where did i go wrong on this? I let Access create the line that is highlited yellow so not sure what went wrong there. Also I cant get the red out of the second command line

    I know I know..frustrating huh?

    Stephanie

  11. #41
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    ooops just saw the "Change "email address" to reference the email textbox: Me.[E-mail Address]" in previous post..let me try that too

  12. #42
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    HAHAHA We ARE maiking progress here!! Now look what it does...

    Click image for larger version. 

Name:	email.png 
Views:	6 
Size:	80.9 KB 
ID:	12067

    The email address is in the CC instead of in the TO box

    Again we are almost there!! I am starting to see the light at the end of the tunnel of this issue! :-)

    Stephanie

  13. #43
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Look in VBA help at SendObject. You have the email address in the CC argument instead of the TO argument.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #44
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Okay, I guess we are off by one comma.

    As you type the SendObject code, look at the intellisense popup tips as an aid in building.
    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.

  15. #45
    Stephanie53 is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    246
    YEEEHAWWW! (that is Texan for HIP HIP HOOORRRRAAYYY..LOL) WE GOT IT!! AND YOU MADE MY WEEKEND!!

    THANK YOU THANK YOU THANK YOU!!

    YOU GUYS ARE THE BEST!!

    STEPHANIE!!

Page 3 of 5 FirstFirst 12345 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Sending HTML files via Access to Outlook
    By Yann63 in forum Programming
    Replies: 4
    Last Post: 02-13-2014, 05:34 PM
  2. sending data into an email body - outlook
    By webisti in forum Access
    Replies: 6
    Last Post: 02-15-2012, 07:05 AM
  3. Sending Outlook E-mail - Run-time error '429'
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 03-01-2011, 09:30 AM
  4. Replies: 1
    Last Post: 03-09-2006, 01:50 PM
  5. Sending email via Outlook (and Exchange2003) from Access2003
    By Larry Elfenbein in forum Programming
    Replies: 0
    Last Post: 11-15-2005, 09:03 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