Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blank Listboxes 2

Status
Not open for further replies.

RussOSU

Technical User
Apr 16, 2001
93
US
I am creating a form which includes a couple textboxes in which information will be entered and used to filter data in a table. The information I want displayed in a listbox also located on that form. Is it possible to have the listbox unpopulated till one of the filters is activated and depopulated with the use of a button to clear the form?

Russ
 
Initially, leave the RowSource property blank. Then, after the filter is applied, set the RowSource property of the list box to what you want (query, etc). When you don't want anything to show in the list box, set it's RowSource to vbNullString.
 
When you want the listbox to be unpopulated, set the RowSource Property to an empty string (""), and when you want the Listbox to be populated, set the RowSource to a Table Name (RowSourceType = "Table/Query"), Query Name (RowSourceType = "Table/Query"), SQL Statement (RowSourceType = "Table/Query"), or put the values in itself with a semi colon between each item (RowSourceType = "List Values")

Note, the RowSource and RowSourceType Property of a listbox are String Data Type format.

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
 
Thank you guys. That helps a lot.

Russ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top