Results 1 to 14 of 14
  1. #1
    penbell is offline Novice
    Windows XP Access 2016
    Join Date
    May 2017
    Location
    Alberta, Canadda
    Posts
    9

    Need to add additional fields to display in e-mail generated from macros in form

    Cross posted in forms section



    I have taken an existing template (Issue Tracker) and added additional fields such as (but not limited to) Address, FirstName, Last Name, Telephone# and I need to add some of these fields to the e-mail and print function that is in the OnClick properties so that they appear in the e-mail or print that is generated from the command button(s).

    In the "Subject" properties of the e-mail, the macros is shown as =Replace(Replace("Issue |1: |2","|1",Nz([ID],"")),"|2",Nz([Title],"")), where and how do I add "address" so that it appears in the subject line of the e-mail that is generated?

    I originally posted a thread in the forms forum, I am not a savy Access user and I was unaware if the e-mail was generated from VBA code or Macros but have now determined that it is a Macros. I did receive a response to my query in the "forms" section of these forums however the suggestion did not work.

    Thanks in advance!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What exactly did not work? Did it produce an error? Incorrect result?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    penbell is offline Novice
    Windows XP Access 2016
    Join Date
    May 2017
    Location
    Alberta, Canadda
    Posts
    9
    Hi Paul,

    There is an error message that pops up when I try to save the changes

    The 'EMailDatabaseObject' macro action has an invalid value for the 'subject' argument.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    And what was that value? I'd try

    =Replace(Replace("Issue |1: |2","|1",Nz([ID],"")),"|2",Nz([Title],"")) & Nz([OtherField],"")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    penbell is offline Novice
    Windows XP Access 2016
    Join Date
    May 2017
    Location
    Alberta, Canadda
    Posts
    9
    This did not result in an error message but did not give me the desired result, the address field was not added into the subject line in the e-mail.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    penbell is offline Novice
    Windows XP Access 2016
    Join Date
    May 2017
    Location
    Alberta, Canadda
    Posts
    9

    Database attached for concern trcker

    Attachment 28587 here is the concern tracker (zipped)

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    How does one recreate your issue?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    penbell is offline Novice
    Windows XP Access 2016
    Join Date
    May 2017
    Location
    Alberta, Canadda
    Posts
    9

    Recreation of error

    I amended to the subject line as per the attached. In the form I then opened the existing form and clicked on the "e-mail" command button, the e-mail that is generated did not put the address in the subject line.

    Click image for larger version. 

Name:	Macro.JPG 
Views:	13 
Size:	54.0 KB 
ID:	28600

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Which form?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    penbell is offline Novice
    Windows XP Access 2016
    Join Date
    May 2017
    Location
    Alberta, Canadda
    Posts
    9
    In the issues detail form.

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Well, this argument:

    =Replace(Replace("Issue |1: |2","|1",Nz([ID],"")),"|2",Nz([Title],"")) & " at " & [address]

    produces this subject:

    Issue 1: Dog at large at 4823 - 56 Avenue

    which seems correct to me.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    penbell is offline Novice
    Windows XP Access 2016
    Join Date
    May 2017
    Location
    Alberta, Canadda
    Posts
    9
    That looks quite lovely but is not what appears on mine, I must be adding it to the wrong area. Can you advise a step by step process for where I go to add this in to the argument. I was going to the "Issue Details form", changed to "design view", under design view clicked "property sheet", hit the "... "button beside On Click, made the changes and hit save. Changed back to "form view" pulled up an existing form and hit the e-mail command button. Still missing the address on the subject line.

    I am sorry to be taking up so much of your time, I have never worked in the back end of the system before.

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    That's what I have in the Subject argument in the embedded macro behind the cmdEmail button on the Issue Details form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 05-08-2017, 11:35 AM
  2. Replies: 2
    Last Post: 01-12-2017, 10:35 AM
  3. Replies: 10
    Last Post: 12-07-2016, 07:44 AM
  4. Replies: 1
    Last Post: 11-21-2016, 06:48 AM
  5. Adding additional fields in form
    By ThebigCt in forum Forms
    Replies: 2
    Last Post: 02-23-2012, 12:33 AM

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