Inserting Strings into a text box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ryan Muller

    #1

    Inserting Strings into a text box

    I'm trying to make a form Thank You letter that I can generate for
    multiple people that took part in an auction. I have a table with all
    of their information but am having dificulties creating the actual body
    of the thank you note.

    What I am trying to do is get it to format like this:

    Dear (reference first name and last name fields from the table):

    Thank you for your donation of (reference to donation field in the
    table). The money we earned from your donation will really be a help to
    our high school program.

    Sincererly,

    X High School PTA

    How do I get the body of the note so I can insert text that will be
    found in every letter along with the info that is specific to each
    customer?

    Your help will be greatly appreciated.

    Thanks

    -Ryan



    *** Sent via Developersdex http://www.developersdex.com ***
  • pietlinden@hotmail.com

    #2
    Re: Inserting Strings into a text box

    Make life easy on yourself. Use mail merge.

    Comment

    • Ronald Roberts

      #3
      Re: Inserting Strings into a text box

      Put the below function in any module. Then you can call it
      in a query like this.

      FullName: fFullName(TblFi rstName, tblMiddleName, tblLastname)


      HTH
      Ron


      Public Function fFullName(fFirs t As Variant, fMiddle As Variant, fLast
      As Variant) As String
      Dim cName As String
      cName = ""
      If IsNull(fFirst) Then
      cName = ""
      Else
      cName = Trim(fFirst)
      End If
      If IsNull(fMiddle) Or fMiddle = " " Or fMiddle = "" Or IsEmpty(fMiddle ) Then
      Else
      cName = cName & " " & Trim(fMiddle)
      End If
      If IsNull(fLast) Or fLast = " " Or fLast = "" Or IsEmpty(fLast) Then
      Else
      cName = cName & " " & Trim(fLast)
      End If
      fFullName = Trim(cName)
      End Function


      Ryan Muller wrote:
      [color=blue]
      > I'm trying to make a form Thank You letter that I can generate for
      > multiple people that took part in an auction. I have a table with all
      > of their information but am having dificulties creating the actual body
      > of the thank you note.
      >
      > What I am trying to do is get it to format like this:
      >
      > Dear (reference first name and last name fields from the table):
      >
      > Thank you for your donation of (reference to donation field in the
      > table). The money we earned from your donation will really be a help to
      > our high school program.
      >
      > Sincererly,
      >
      > X High School PTA
      >
      > How do I get the body of the note so I can insert text that will be
      > found in every letter along with the info that is specific to each
      > customer?
      >
      > Your help will be greatly appreciated.
      >
      > Thanks
      >
      > -Ryan
      >
      >
      >
      > *** Sent via Developersdex http://www.developersdex.com ***[/color]

      Comment

      Working...