Results 1 to 3 of 3
  1. #1
    Budatlitho is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    Mar 2016
    Posts
    36

    Set default value of list box to empty or null?

    I have a list box in a form whose record source is a query. On opening the form, the first value from the query populates the field. How can I make the default value "blank" or Null? Tried setting the default value to " " and also Null but neither works.
    Probably missing something really simple....


    TIA
    Bud

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    A list box by definition lists the results of a the query or table in the rowsource.

    Either only set the rowsource after something else on the form "triggers" that need or hide it on the same basis.
    The only other method is to Union the query with a " " empty value, but that means the user can choose it, which is not probably what you want.
    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 ↓↓

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    might help to show what the sql to your query is and what field (if any) it is bound to. Also if the listbox is the first control based on tab order, and the listbox is unbound or if bound the main form is on a new record, it has the focus so will automatically select the first item in your listbox. If this is the case, change the tab order or create a textbox called say 'parkFocus' make sure it is visible but set top, left, height and width values to 0 and set the tab order to 0

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

Similar Threads

  1. Null or Empty for Date Select Textbox
    By dccjr3927 in forum Programming
    Replies: 3
    Last Post: 03-27-2019, 11:26 AM
  2. Can I disable a button if a field is empty (null)?
    By Tall_Paul in forum Programming
    Replies: 9
    Last Post: 02-03-2018, 05:59 PM
  3. If query result is empty, put 0 as default value
    By themushroomking in forum Queries
    Replies: 8
    Last Post: 07-18-2017, 09:07 AM
  4. NULL vs. Empty String
    By obiron in forum Access
    Replies: 3
    Last Post: 08-02-2011, 08:43 AM
  5. saving records without null or empty fields
    By amber mara in forum Access
    Replies: 1
    Last Post: 05-05-2010, 02:34 PM

Tags for this Thread

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