Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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...


Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page