Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Email & Letters (A2K/XP)

    Hello All:

    Attached is a sample of a database I have with which I am trying to email letters. The letters are 3 pages long and each email address should get 1 letter. The way it is now, each email address is getting all the letters. I have tried to follow previous posts on this subject (#275460, #547736, etc). I think I have hit the proverbial wall. The form needs to be opened and "TA" entered as the prefix. The code from the previous posts is behind the cmd button. Any and all suggestions are greatly appreciated. TIA.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Email & Letters (A2K/XP)

    You forgot an essentail part from <post#=275460>post 275460</post#>: you need code in the On Open event of the report to limit the records displayed to those whose e-mail address has been set in the global variable.

    See attached version (I cleaned up the code a bit)

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Columbus, Ohio, USA
    Posts
    286
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Email & Letters (A2K/XP)

    Thank You Hans. What takes us mere mortals days, you do in minutes. BTW, Congratulations on your posts. A valuable asset to us all.

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Email & Letters (A2K/XP)

    Thank you Bill & Hans

    I was looking for this, worked fine with a2k and ol2k and for testing:

    ' For testing (Access 2000, 2002 or 2003 only):
    'DoCmd.OpenReport stDocName, acViewPreview

    John

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Email & Letters (A2K/XP)

    In the code in the database I posted, I added acDialog as WindowMode argument. This causes the code to wait until the user closes the report before opening it for the next e-mail address, so you can check all output. If you omit acDialog, the code will continue, so you'll only see the result for the last e-mail address. But acDialog for reports was introduced in Access 2002, so you can't use it in Access 2000.

Posting Permissions

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