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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a list box where > 1 value is selected 1

Status
Not open for further replies.

spkplf

Instructor
Joined
Apr 28, 2003
Messages
4
Location
US
Using access 97, what is the easiest way to allow users to select > 1 value from a field on a form?
 
Do you mean you want to select more than one item in a listbox??

If so, in the list box properties, go to the 'Other' tab and set the multi select property.



There are two ways to write error-free programs; only the third one works.
 
that allows me to select more than 1 from the list box, however it is not saving my selections the next time I open the record.
 
If you are using a bound form and set the listbox to multi select, the value of the listbox will always be null.

If you want to save the values you will need to loop through all the items in the list an write code to save the ones that are selected.

If your listbox was called for example lstName you can do this something like...

Dim intCount As Integer

For intCount = 0 To lstName.ListCount -1
If lstName.Selected(intCount) Then
'code to save record here
End If
Next intCount


There are two ways to write error-free programs; only the third one works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top