Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    correct coding (2000)

    Edited by HansV to prevent <!t>[question] being interpreted as a smiley

    Hans gave me some useful guidance on writing vb code to delete surplus letters in a field where that field was being stripped to populate the to: address in an e mail. I have adopted that into my code but now the e mail doesn 't generate and the code goes through error handling. Could somebody please suggest what I am doing wrong, here is my code:

    DoCmd.SendObject To:=Left([me.CC.column1], InStr([me.CC.column(1)], "-") - 2), Subject:="Technical Support Survey - Case ID:" & " " & Me!ID, _
    MessageText:=vbCrLf & vbCrLf & vbCrLf & "TCC recently assisted you with a query (details below). To enable TCC to improve the support we offer, please complete the attached survey and return this email to the sender." _
    & vbCrLf & vbCrLf & "Technical Consultant:" & " " & Me!TCC.Column(1) _
    & vbCrLf & vbCrLf & "Date of referral:" & " " & Me!Date _
    & vbCrLf & vbCrLf & "Policy number:" & " " & Me![question Subform1].Form![policy number] _
    & vbCrLf & vbCrLf & "Surname:" & " " & Me![question Subform1].Form![case surname] _
    & vbCrLf & vbCrLf & "Date of Birth:" & " " & Me![question Subform1].Form![DOB] _
    & vbCrLf & vbCrLf & "Question:" & " " & Me![question Subform1].Form! <!t>[question] _
    & vbCrLf & vbCrLf & "Answer:" & " " & Me![question Subform1].Form![Text113] _
    & vbCrLf & vbCrLf & " " _
    & vbCrLf & vbCrLf & "Kind Regards, Technical Support" _
    , EditMessage:=True


    Many thanks Darren.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: correct coding (2000)

    What error message do you get?

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: correct coding (2000)

    Thanks Hans...cannot find the field 'l' referred to in your expression. I can't see what it refers to at all.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: correct coding (2000)

    Shouldn't me.CC.column1 be Me.CC.Column(1) ?
    And I wouldn't put square brackets around it.

  5. #5
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: correct coding (2000)

    Thank you Hans, it was the brackets.

    Cheers Darren.

Posting Permissions

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