Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

email issue...works only ONE TIME

Discussion in 'Information Technology' started by Mike Robinson, Jul 28, 2006.

  1. Mike Robinson

    Mike Robinson
    Expand Collapse
    Guest

    If anyone can help me with this issue I would greatly appreciate it.
    I have a work order system and I would like to email specific information.
    Instead of attaching a file, I have chosen to add the information into the
    email's message text.
    The problem that I am having is that the code I am using will only
    work ONE time. The 2nd time you try to execute the code I get...
    "...Can't find the field 'Forms' refered to in your expression".

    Here is the code I am using:
    'On Error GoTo ERR01

    Dim strSubject, strMessageText As String

    strSubject = "Work Order: " & Me.txtWorkOrderNumber

    strMessageText = Chr(13) & Chr(10) & Chr(13) & Chr(10) & Chr(13) & Chr(10)
    'Add some space from top
    strMessageText = strMessageText &
    "*****************************************************************"
    strMessageText = strMessageText & Chr(13) & Chr(10)
    strMessageText = strMessageText & "Work Order: " & Me.txtWorkOrderNumber
    strMessageText = strMessageText & Chr(13) & Chr(10) & _
    "Entered: " & Me.txtDateEntered & Chr(13) & Chr(10)
    strMessageText = strMessageText & Chr(13) & Chr(10) & _
    "Target: " & Me.txtDateTarget & Chr(13) & Chr(10)
    strMessageText = strMessageText & Chr(13) & Chr(10) & _
    "Equipment: " & Me.txtEquipmentName & Chr(13) & Chr(10)
    strMessageText = strMessageText & Chr(13) & Chr(10) & _
    "Task: " & Me.txtTask & Chr(13) & Chr(10)
    strMessageText = strMessageText & Chr(13) & Chr(10) & _
    "Details: " & Me.txtWorkOrderDetails & Chr(13) & Chr(10)
    strMessageText = strMessageText &
    "*****************************************************************" 'Visual
    Seperator

    DoCmd.SendObject acSendNoObject, , acFormatTXT, , , , strSubject,
    strMessageText

    'ERR01:
    'Debug.Print Err.Number
    'Debug.Print Err.Description

    'Exit Sub

    End Sub
     
  2. Loading...


Share This Page