Results 1 to 4 of 4
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

    Missing stuff in Email Subject line

    I have
    .Subject = Titles & " - " & Format(Date, "dd mmm yyyy")

    Titles is a string from a query where the user selects a start stop date on a form referencing a table.

    when I run the code I get:
    This is the title13 Apr 2016



    I lose the " - " part.


    I have
    Dim Titles as Variant
    Titles = DLookup("[Title]", "[IA Expiration]", "Title")

    where is the - going? It seems to skip right over it.

    Thanks
    Wayne

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    the 3rd param is a where clause, you can leave it empty or you must list what you want to find

    Titles = DLookup("[Title]", "[IA Expiration]", "[TitleID]=123")

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Try changing to:
    Code:
    Dim Titles as Variant
    Titles = DLookup("[Title]", "[IA Expiration]", "Title")
    Titles = Titles & " - " & Format(Date, "dd mmm yyyy")
    
    msgbox Titles
    
    .Subject = Titles
    What does the message box display?

    On another note, something looks wrong with the DLookup function.
    The syntax is:
    DLookup(Expr, Domain, Criteria)

    The criteria clause is missing a value. Should be something like "Title = '" & Me.Something & "'" (if 'Title' is text)
    Code:
    Titles = DLookup("[Title]", "[IA Expiration]", "Title = '" & Me.Something & "'")

  4. #4
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Got it. It's more like a work around though as I am adding an extra step for concatenating in 1 value, then using the new value for the subject. I will go through and remove the not required third part of the Dlookup stuff
    Thanks ssnafu

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

Similar Threads

  1. Replies: 5
    Last Post: 11-01-2014, 05:18 PM
  2. can your report name be sent to an email subject
    By Compufreak in forum Access
    Replies: 8
    Last Post: 11-20-2012, 03:03 AM
  3. VBA check for email subject line
    By problem_addic in forum Access
    Replies: 4
    Last Post: 03-12-2010, 02:33 PM
  4. Field Name into Subject/Body of an email?
    By Stanggirlie in forum Programming
    Replies: 0
    Last Post: 01-05-2009, 11:51 AM
  5. Email field name into subject/body?
    By Stanggirlie in forum Access
    Replies: 0
    Last Post: 01-02-2009, 11:07 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