By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 2,646 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Automatically select all records from a list box

P: n/a
Please can someone help me here. This is probably pretty basic stuff
but i'm stuck.
I have a form that contains a list box. when i open the form i want
all the records within this list box to be automatically selected upon
the forms opening? does anybody know how to do this?

any help greatly appreciated. thanks
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ormy28 wrote:
Please can someone help me here. This is probably pretty basic stuff
but i'm stuck.
I have a form that contains a list box. when i open the form i want
all the records within this list box to be automatically selected upon
the forms opening? does anybody know how to do this?


First, make sure the Multiselect property is set to either 1 or 2.

Then, in the Open event of the form, do this:

dim i as integer
for i=0 to yourlistbox.listcount
yourlistbox.selected(i)=true
next

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.