Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Evansville, Indiana, USA
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DoCmd.SendObject (2007)

    Here is my code for sendobject:

    Dim username As String
    username = Left(Me.cmbBoss.Column(1), 1) + Me.cmbBoss.Column(2)
    DoCmd.SendObject To:=username + "@domain.com", Subject:="PO Ready for Approval", _
    MessageText:="Please review P.O. #" & [Forms]![frmAddPO]![txtPO], EditMessage:=False

    It works fine except for the last line. The message the username receives says "Please review P.O.#" and nothing else. I want the PO number that is held in txtPO on frmAddPO to be displayed in the message. Is the above statement structured correctly?
    Thanks,

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

    Re: DoCmd.SendObject (2007)

    Is frmAddPO the form running the code, or another form?
    If it is another form, is it open when you run the code?
    Are you sure that txtPO contains a non-blank value?

  3. #3
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Evansville, Indiana, USA
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DoCmd.SendObject (2007)

    frmMailTo is running the code. Both forms are open when the code runs. I found a mistake in the way I was setting the value of txtPO. I was setting the value of txtPO and then resetting it before the message was generated. The code from before is correct.
    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
  •