Results 1 to 7 of 7
  1. #1
    kpit is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    5

    Suppress Blank Values in a Lookup Field

    Yes, I know that using Lookup Fields in tables is not a great idea, but I'm picking up from another person under a huge time crunch, so am trying to make due. I have a form with a Document field that looks up a list of documents from a master document list (SELECT MLTABLE.Document_ID, MLTABLE.[Doc#, Title, Version (Date)] FROM MLTABLE ORDER BY MLTABLE.[Doc#, Title, Version (Date)] It works GREAT; however, due to the nature of the master document list, there are blanks in the Doc#, Title, Version (Date) field that is displayed, so when you click the drop-down list, the choices appear to be blank - you have to scroll past the blanks to find the alpha list of documents. How can I tell the look-up to NOT list the blank records in the drop-down list?



    Any assistance you can lend is MOST appreciated!

    Kimberley

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,421
    SELECT MLTABLE.Document_ID, MLTABLE.[Doc#, Title, Version (Date)] FROM MLTABLE WHERE MLTABLE.[Doc#, Title, Version (Date)] IS NOT NULL ORDER BY MLTABLE.[Doc#, Title, Version (Date)]

  3. #3
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    I appreciate you didn't design this , but I think you just became a very early contender for this months award for worst field name

    Comma's, special characters, and parenthesised reserved word all in one go !
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  4. #4
    kpit is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    5
    that worked perfectly...so easy I should have figured it out. The people who entered the document titles also sometimes put blank spaces in front of the actual title...is there a way to suppress those AND have those entries put into alpha order with the items that do not have blank spaces in front of the title?

  5. #5
    kpit is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    5
    You're telling me!!! The problem is it feeds from another table and when they tried to change the Access field name the links didn't work well. CRAZY! I could go on for weeks about it...Thanks for the laugh though!

  6. #6
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,421
    Comma's, special characters, and parenthesised reserved word all in one go !
    Agreed. If the rest of the DB is like this, debugging time might be boosted tenfold!

  7. #7
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,421
    .is there a way to suppress those AND have those entries put into alpha order with the items that do not have blank spaces in front of the title?
    You could run some update queries to remove leading and trailing spaces via the TRIM function. Take care though, that this might have unforeseen effects elsewhere and needs careful analysis.

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

Similar Threads

  1. Suppress Data Field if Blank
    By Alaska1 in forum Access
    Replies: 3
    Last Post: 10-29-2018, 09:58 PM
  2. Suppress Blank row in a continuous form
    By dgmdvm in forum Forms
    Replies: 3
    Last Post: 09-23-2017, 11:23 PM
  3. Lookup values not appearing in Lookup field?
    By dominover in forum Access
    Replies: 4
    Last Post: 03-05-2016, 05:01 PM
  4. Replies: 4
    Last Post: 02-22-2016, 04:01 AM
  5. Combo Box Lookup field blank.
    By Robert2150 in forum Access
    Replies: 6
    Last Post: 10-02-2015, 11:50 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