Results 1 to 7 of 7
  1. #1
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150

    Make Listbox Emplty


    Hi

    How to make a listbox appear empty or blank on form load until a value is entered into the textbox?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Maybe you should use a combobox instead.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150
    Hey

    i am trying to create a search form in access, when created the list box shows the values instead of an empty listbox, is there anyway i could empty the listbox upon form load?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Okay, don't set listbox RowSource until input into textbox.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150
    could you please explain,

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Don't set listbox RowSource property in design view. Do it with code so in text AfterUpdate event, something like:

    Sub textboxname_AfterUpdate()
    Me.listboxname.RowSource = "SELECT * FROM sometable WHERE somefield='" & Me.textboxname & "'"
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Eranka is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    150
    It worked, Thanks alot mate.

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

Similar Threads

  1. Make listbox selection a requirement
    By Homegrownandy in forum Programming
    Replies: 3
    Last Post: 08-01-2018, 07:40 AM
  2. how to make columns in ListBox
    By LUTINO in forum Programming
    Replies: 7
    Last Post: 09-10-2016, 02:12 AM
  3. Replies: 12
    Last Post: 06-08-2012, 02:37 AM
  4. Replies: 3
    Last Post: 02-01-2011, 09:47 AM
  5. Replies: 6
    Last Post: 03-27-2010, 11:18 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