Results 1 to 15 of 15
  1. #1
    mademen is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    10

    S.O.S. with VBA :-)

    Hi All



    I have a database which is meant to make our life easier :-)

    we have different suppliers with different orders every week.
    the meaning is to upload an excel sheet 'PUStoUpload'

    every supplier has an order witha unique PO number. under that number you can have different partnumbers with the quantitys.

    please see attached DB. when the user hit's the generate email button. the vba should go trough the "PUStoUpload" list and for every unique PO outlook should be opened with there the PO number, partnumbers and quantity.

    so if i have 20 unique PO numbers. 20 emails should be opened.

    The PO numbers are from supplies which are linked to the contacttable. so user can select an email.

    can somebody help me with this one?

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    There is no attachment to view.

  3. #3
    mademen is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    10
    Attachment 4872

    Sorry, my bad. now attached

  4. #4
    mademen is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    10
    Hi Do you think that you can help me out with this one?

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Many who follow these posts do not have AC2007 or 2010 so can not open accdb. You may get more responses if you include an mdb version as well.

  6. #6
    mademen is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    10
    Attachment 4885

    Hi

    mdb version attached

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    I have looked at your mdb. Am sending a slightly adjusted copy in which I added code to your button to Generate Email. It simply writes some data to the immediate window.
    I added a reference to the Outlook library.

    I bypassed your Generate email sub because it contained errors and comments.

    I think your tables need some design work, but maybe I'm not understanding your situation exactly.

    How do you determine the recipient(s) of the email?
    Do you have an email text?

    Please provide more info (some details as to exactly what gets sent to whom under what conditions....

    Please try the button on the form and look at the immediate window (CTRL-G).

    It's a matter of proceeding slowly to get the pieces working together.

  8. #8
    mademen is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    10
    Hi

    Thank you for taking the time and to look into it.

    So as you can see the user can import a Pickupsheet file (PUS).
    on that file we have different suppliers which have they own Duns or Alias number.

    in the table "SuppContacts". you have the duns number of supplier with the contact details.
    ------------------------
    every supplier has his own orders which are reflected with the PO Number (Thats the orders number). in the order you can have different parts (partnumbers) with quantitys.

    so meaning of the generate email button: when the users hits the button. the vba should go trought the PUSToUpload sheet. for every unique PO number he should open an email. contacts can be linked with the SuppContacts table so the email address is already filled in. the email should look likeAttachment 4899

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Each unique PO for each supplier gets an email. There is Only 1 contact for each Supplier.

    What experience do you have with vba? and Access?
    Did you try the sample button on the form?

  10. #10
    mademen is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    10
    i'm a nooby in VBA for access. So this is a litle bit above me

  11. #11
    mademen is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    10
    the most important is that for each supplier an email gets open with the criterie mentioned above. if 1 supplier has 3 PO's they can come into 1 email.

  12. #12
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Where are you located? It's been 1 hour almost exactly from the time you did your last post until I just received it.
    If you are responsible to maintain the application, you'll have to learn some vba.

  13. #13
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Here is latest.

    I have the data on the html body, but it only displays

    In order to .Send the email, you have to comment out the .Display and make .Send operational,

    There is work to do, but it should get you started.

    Good luck.

  14. #14
    mademen is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2011
    Posts
    10
    Thank you man, this is a great help!!!

  15. #15
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Glad it's helpful. I don't do much with Outlook, but it's a learning exercise.
    Post if you need more.

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

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