Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    139

    Unanswered: Include text box info in Sub line of sendobject

    I have a form with a control button on it that will send a report to our customer based on the form. The button opens a macro that uses the sendobject function. Currently, on the Subject line I have Store Report but the customer would like the store number to follow that. Is there anyway that I can reference the store field from the form and place it in the subject line?

    Any help is appreciated!
    B&R

  2. #2
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Just add the contents of the text box to the subject field.

    Dim strSubject As String

    strSubject = "Subject " & Me.txtStoreNo

  3. #3
    Join Date
    Feb 2004
    Posts
    139
    Yes, this sounds like it would work but I am a newbie. Where would I put this string to make it work. All I know is the actual subject line in the sendobject feature.

    Appreciate your time and help!
    B&R

  4. #4
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Post the code you have so far.

  5. #5
    Join Date
    Feb 2004
    Posts
    139
    As requested, here is the code.

    It was a macro using the SendObject function that I originally sent in the message about. I converted the macro to code and then tried the ME.LOCID and it did not work. I then put in the forms![SR ORDER FORM]![LOCID]. This puts in the location but it sends the message but I have never received it. It also closes access. Oh well, here is the code. Any help is appreciated.

    Function SEND_SR_REPORT_TO_KERRI()
    On Error GoTo SEND_SR_REPORT_TO_KERRI_Err

    DoCmd.SetWarnings False
    DoCmd.SendObject acReport, "SR RECEIVING REPORT", "RichTextFormat(*.rtf)", "RHERM1@EARTHLINK.NET", "", "", "STORE RETURN REPORT " & Forms![SR ORDER FORM]![LOCID], "", False, ""
    DoCmd.OpenQuery "UPDATE SR RECEIVING REPORT", acViewNormal, acEdit
    DoCmd.Close , ""


    SEND_SR_REPORT_TO_KERRI_Exit:
    Exit Function

    SEND_SR_REPORT_TO_KERRI_Err:
    MsgBox Error$
    Resume SEND_SR_REPORT_TO_KERRI_Exit

    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •