Results 1 to 6 of 6
  1. #1
    bamptontowers is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    May 2013
    Posts
    3

    ACCESS 2010 DLookup and Left Trim

    I am trying to use DLOOKUp and Trim in a calculated control on a form - D look up works but when i add Left trim to trim a telephone number to just the prefix - it wont work



    =DLookUp("[CSP]","[Csp_Codes]","[Data] = '" & [Forms]![Application_Frm]![CommsData_tbl subform].[Form]![Data] & "'") - Works OK
    =DLookUp("[CSP]","[Csp_Codes]","[Data] = '" & [Forms]![Application_Frm]![CommsData_tbl subform].[Form]![Left](Trim([Data]),7) & "'") - appears to put square brackets around Left ??

    Any help appreciated

    Dave

  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,641
    The two functions would go around the entire form reference, not just the last bit.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    bamptontowers is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    May 2013
    Posts
    3
    Quote Originally Posted by pbaldy View Post
    The two functions would go around the entire form reference, not just the last bit.
    Can you explain what ive left out - Thanks

  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,641
    Left(Trim([Forms]![Application_Frm]![CommsData_tbl subform].[Form]![Data]), 7)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    bamptontowers is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    May 2013
    Posts
    3

    Thank You

    Quote Originally Posted by pbaldy View Post
    Left(Trim([Forms]![Application_Frm]![CommsData_tbl subform].[Form]![Data]), 7)

    Thank You its works a treat

    Dave

  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,641
    No problem Dave, and welcome to the site by the way!
    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. Need Help With DLookUp Function in Access 2010
    By fmartz in forum Programming
    Replies: 2
    Last Post: 09-05-2012, 09:34 AM
  2. Replies: 0
    Last Post: 07-31-2012, 12:25 PM
  3. how to trim text in a column using sql query of ms access
    By learning_graccess in forum Access
    Replies: 4
    Last Post: 12-05-2011, 07:15 AM
  4. Features Left in or out of 2010
    By Paul H in forum Access
    Replies: 7
    Last Post: 11-08-2011, 12:57 PM
  5. Replies: 3
    Last Post: 02-02-2011, 01:00 PM

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