Results 1 to 34 of 34

Thread: [RESOLVED] getting the contact address from query in access

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Resolved [RESOLVED] getting the contact address from query in access

    hello
    i was wondering if anyone could help me with mail
    merging outlook from access!!!
    thanks in advance

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: mail merge

    Usually a mailmerge will involve Word to some degree.

    You need to give more information.

    What version of Office?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: mail merge

    i want to use the query to get the list of emails which i wan to send the emails to!!!
    can you help plz!!!

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: mail merge

    You will want to add a reference to Microsoft ActiveX Data Objects 2.x Library in Outlooks VBA IDE. Then its basic ADO code to connect and retrieve the recordset. See tutorial located here - http://www.vbforums.com/showthread.php?t=337051

    Then its a matter of creating an email and adding the email addresses to its To property.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Smile getting the contact address from query in access

    i want to send the bills qutomatically to the customers
    how can i do so ?!
    the point is that i need to get the emails of the customers from the query and then somehow use them in outlook to send them ?!
    can anyone help?!

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: getting the contact address from query in access

    By "get the emails" do you mean get email addresses that are stored in your database?

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: getting the contact address from query in access

    Are you using VB6 or Outlook VBA?

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: getting the contact address from query in access

    Quote Originally Posted by RobDog888
    I think I should merge the threads as I have found another duplicate thread in the db forum.

    http://www.vbforums.com/showthread.php?t=400239
    My intent was to merge, but I don't know whether the resulting single thread should be in ClassicVb or Office Development.

    I guess you can just pick one, and then move if necessary as the member has not responded to the question on what platform he is using.

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: getting the contact address from query in access

    Threads Merged.

    I choose the Office Dev forum as its contains both Access and Outlook.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    well i don't it should be complicated i just want to emeil the bills which are made in access to the customers automatically after one month !!!
    what should i do !!!!!!!!!!!!!!!!!!????????????????????

  11. #11
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Re: getting the contact address from query in access

    Quote Originally Posted by parisa_ch
    well i don't it should be complicated i just want to emeil the bills which are made in access to the customers automatically after one month !!!
    what should i do !!!!!!!!!!!!!!!!!!????????????????????
    Answer the questions asked above.
    Tengo mas preguntas que contestas

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    what question?
    i'm suppose to get the answer from someone i mean if i knew the answer i would have done it myself.

  13. #13
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Re: getting the contact address from query in access

    See posts 6 & 7 by Hack above. No one can really help until you give more information.
    Tengo mas preguntas que contestas

  14. #14
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: getting the contact address from query in access

    We can help you but just giving a generic scnerio doesnt help us to help you.

    Btw, what version of Office and what OS will this be on? Is it for distribution or just on your system?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    well let me tell you my course work
    this system is used on a single worksation in a center which is used to make booking for the village hall
    now one of the things this system is sopposed to do is to produce bills for the customers who made the booking and in order to save money oon postage just email it to them instead i want to get the system to email the bills automatically at the end of each month.
    can you help me now please.
    thank you

  16. #16

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    the bookings are save in the database so the emails are saved in the customer table.

  17. #17
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: getting the contact address from query in access

    Ok, but are you using VB6 or the VBA behind Access or Outlook?

    Also, which version Office and Operating System?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  18. #18

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    well i haven't done anything in outlook yet
    i have ony started programming i don't know what to do?!!??!!?

  19. #19
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Re: getting the contact address from query in access

    From your comment above stating this is "course work", I'll assume this is a school assignment.
    You still haven't answered any of the questions above. I'm not going to repeat them for you, since you seem intent on ignoring them.
    In all sincerity, why do you expect people here to help you when you ignore their requests for more information?
    I understand that you may be a complete newcomer to coding and Visual Basic, but that doesn't explain why you don't answer the questions of people who try to help you.
    Tengo mas preguntas que contestas

  20. #20
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: getting the contact address from query in access

    Plus, everyone is wiling to help but no one will write all the code for you. You need to let us know the answers and be willing to make an effort.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  21. #21

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    well i'm using vba
    and window xp
    sorry i didn't mean to ignore answering your questions!!!

  22. #22
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    Re: getting the contact address from query in access

    Are you developing your app in Access or Outlook, and which version? VBA is a version of Visual Basic that is common to all Office programs - Access, Excel, Outlook, Word, etc., but the specifics of how you accomplish a particular task depend on which program you're using. For example, you can program Outlook to do things from code in Access, but the code would be different than if you were programming within Outlook itself and getting your names from a table in Access.
    Tengo mas preguntas que contestas

  23. #23

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    well i'm tring to code stuff in access if possible but if it not possible than i would do it in outlook
    which one is easier?

  24. #24
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: getting the contact address from query in access

    Easiest way to do this is in Access since you are using Access code already.

    Create a recordset of your email addresses and then...

    VB Code:
    1. Do While oRs.EOF = False
    2.     Application.DoCmd.SendObject acSendNoObject, , acFormatTXT, oRs.Fields("EmailAddress").Value, , , "Spam", "This is the message text", False
    3.     oRs.MoveNext
    4. Loop
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  25. #25

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    where should i put this code.i'm mean which part of access?the table?

  26. #26

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    i think since i'm sending the reports i should put it some where in the report.or should i make a command button and then locate it there?!

  27. #27
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: getting the contact address from query in access

    You can place it behind your form in a button click event procedure.

    You can not place any code behind a table.

    You also need to create your recordset of the email addresses.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  28. #28
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: getting the contact address from query in access

    If your sending an object, like a report, then you need to change the code a bit. Change acSendNoObject to acSendReport and then the next parameter (the blank one) will be the report name.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  29. #29

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    thank you

  30. #30

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    what should i do if i want the system to send it automatically at the end of each month?!

  31. #31
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: getting the contact address from query in access

    You would need to keep your db open and use an API or two to create a timer event checking what day it is, once a day. Then if its determined to be the last day, call the procedure to send the emails.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  32. #32

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    well i have linked visual basic 6.0 to access to make my coursework a bit more complicated than the others (trying to be smart) ))))))
    now should i put the timer in the visual basic codes and use the format function thing?!

  33. #33
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: getting the contact address from query in access

    So then your using a combination of Access VBA and VB6.

    Yes, you will place a timer control on a form and in the timer event decide if you want to email the reports or not.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  34. #34

    Thread Starter
    Addicted Member
    Join Date
    Feb 2006
    Posts
    139

    Re: getting the contact address from query in access

    c00o0o0o0ol
    thank you

Posting Permissions

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



Click Here to Expand Forum to Full Width