Results 1 to 12 of 12

Thread: Show data

  1. #1
    Join Date
    May 2012
    Posts
    89

    Unanswered: Show data

    I need some help with a database im planning to build.
    I want to build a dB that saves the data that was put in emails of (EXTERNAL) contracters that are being sent out bij te Office Operation Center.
    I was planning to build a dB where data is entered in forms and that stores the data in tables and when the adding of data is finished the total will generate an view that shows the total of the data that will need to be sent and after that
    the sent mail-cmd do his thing.
    The only thing i dont know how to get done is that i want the data that has been entered to be generated in a email instead of an attachmend that will be added to the mail.

    Hope someone can give me some pointers to how this is done.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    As a general rule, you can build the body of an email to be sent. Using a variable and getting values from the form the code is in:

    Code:
    strBody = "Dear " & Me.FirstName & " some more text here"
    Basically you concatenate literal text with form values to build a finished product. You can get quite creative, using either vbCrLf or the combination of Chr(13) & Chr(10) for new lines. With some email methods you can also use HTML tags. You would then use the above variable in the chosen email method.
    Paul

  3. #3
    Join Date
    May 2012
    Posts
    89
    Hi pbaldy thx for the response.
    Im to these things in access where do i start? in a form report ?? and what command must i use to sent cause im only known with the SentObject command.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The technique can be used with SendObject. Where do you want it done? It can be done from practically anywhere, though most common is probably a form.
    Paul

  5. #5
    Join Date
    May 2012
    Posts
    89
    Oke that's familiar to me if converted the macro sent object but my question now is how do i make the mail gearing like a mail that is used at this time.
    Now we use a template that look sort of like this:

    Dear sir/madame.

    Text...
    Text...
    Text...

    With regards.

    Operation Center.
    070-23121441
    Den Hage.

    And if i want to use lets say an enter then the string is broken how do i do that to make the mail similar.

  6. #6
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Are the values on a form? If so, look at post 2 and start to build the email text using that method. Post back if you get stuck.
    Paul

  7. #7
    Join Date
    May 2012
    Posts
    89
    No im sure im still getting the same problem i was at the beginning the only ting i can do when i use the sent object command im getting a mail with an object attachment of the form.
    If i edit the string i get a mail with text without formation and not inserted the info that i need it....

  8. #8
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Since I haven't seen your code, I have no idea where you're going wrong.
    Paul

  9. #9
    Join Date
    May 2012
    Posts
    89
    This is the code that i converted from the macro (sendobject):
    DoCmd.SendObject acForm, "Form1", "HTML(*.html)", "OOS@mail.com", "", "", "", "Dear sir/madam. ", False, ""

  10. #10
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    So you've made no effort to do what I mentioned in my first post? Let's start with something simple, because you're going to do most of the work here. Try

    Dim strBody As String
    strBody = "Dear " & Me.PickATextBox"
    DoCmd.SendObject , , , "OOS@mail.com", "", "", "", strBody , False, ""

    substituting some textbox on the form for "PickATextBox".
    Paul

  11. #11
    Join Date
    May 2012
    Posts
    89
    O you dit indeed mentioned it sorry bout that...
    That works fine, but what if i want to generate more lines of text end lets say a format with lines and collored text and hyperlinks???
    But mainly the next lines...

  12. #12
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    did you miss:

    Quote Originally Posted by pbaldy View Post
    using either vbCrLf or the combination of Chr(13) & Chr(10) for new lines. With some email methods you can also use HTML tags.
    Paul

Posting Permissions

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