Results 1 to 6 of 6
  1. #1
    l3kris is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    4

    Question Creating datamacro to retrieve data from 2 tables

    Hi! I'm new to this forum but it seems to be the right place to find answers for most of my access needs

    In my Access 2013 (/365) database I have 2 tables: tblClient and tblOrder. tblClient has client name and email address (and more). tblOrder has order date, shipping date and item ordered (and more).

    A query qOrderdetail picks up data from both tables and shows it all in a form. Now, from this form I'd like to be able to press a button and send an email to the single client on the screen, giving details on the order. And that's where I get lost :-P Any help is greatly appreciated.

    And BTW: English is not my native language, so feel free to ask if you need clarification on something - I tried explaining as best I could.
    Also: I hope this is the correct subforum for the question.


    And lastly: I know how to make a datamacro that does the above - as long as all the needed data is in one table only...

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Email is common topic in forum. Options:

    1. SendObject method - quick Access Help search should get you started

    3. VBA opens and manipulates Outlook (or CDO or Gmail, etc) objects - more advanced coding - here is one thread for a start https://www.accessforums.net/program...ook-21903.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    l3kris is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    4
    Thank you for your reply. Actually, my question is not so much about the email part (which I got down) but more about the datamacro / query from 2 tables combination.

    As to your suggestions:
    1. The SendObject method is not relevant, since I'm not attaching anything to the mail - it's just a confirmation note that's being sent.

    3. I may resort to VBA if that turns out to be the better solution. However, most tutorials on this subject are about how to email a number of people, not just a single person. That is why I wanted to use the datamacro option because when being called from a form it already has the correct person in question.

    I'm still hoping someone has experience with datamacros and can point me in the right direction?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    SendObject can be used to send email even if not attaching anything.

    Data macros are new with Access 2010 and I have not used, aside from a few tests. Could probably have AfterUpdate data macro run SendObject or call code (VBA function or regular macro) that runs SendObject.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    l3kris is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    4
    Quote Originally Posted by June7 View Post
    SendObject can be used to send email even if not attaching anything.
    I'll look into SendObject some more, then.
    Quote Originally Posted by June7 View Post
    Data macros are new with Access 2010 and I have not used, aside from a few tests. Could probably have AfterUpdate data macro run SendObject or call code (VBA function or regular macro) that runs SendObject.
    They're new to me as well but seem promising - hence my interest in learning more

  6. #6
    l3kris is offline Novice
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    4
    No matter what I tried, nothing worked, not data macros, not VBA, not anything at all. It turned out that the database somehow was corrupt.

    After a complete export to a new database, I have had no problems with VBA, Access macros or data macros!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-24-2015, 11:49 AM
  2. Replies: 1
    Last Post: 03-17-2014, 12:26 PM
  3. Replies: 6
    Last Post: 12-12-2013, 11:44 PM
  4. Replies: 3
    Last Post: 08-18-2012, 03:25 AM
  5. Replies: 1
    Last Post: 04-24-2012, 02:36 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums