Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jul 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    emailing from a form (access 2007)

    I have a form with a button that adds a new item number from a text box to a table. I would like to use that same button to send an email to notify a set of users (probably only two or three) of the item number added. Is there a simple way to do this using visual basic code?

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

    Re: emailing from a form (access 2007)

    You can add a line like this to the On Click event procedure of the command button:
    <code>
    DoCmd.SendObject To:="john@this.com; mary@that.com", Subject:="New number assigned", _
    MessageText:="The new number is " & Me.txtNumber, EditMessage:=True
    </code>
    In this example, the number is taken from a text box named txtNumber.
    The message is displayed on screen so that the user can modify it if needed, then send it.
    If you want to send it without human intervention, use <code>EditMessage:=False</code>

  3. #3
    New Lounger
    Join Date
    Jul 2008
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: emailing from a form (access 2007)

    It works. Thanks!

Posting Permissions

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