Multi-Select List Boxes

  • Thread starter Thread starter D Collins
  • Start date Start date
D

D Collins

Hello,

I have a form that acts like a wizard where there are
list boxes with available choices and another list box
with choices they have moved over to it with command
buttons--the code works fine.

My question: I have a few available list boxes and a
complimentary selected list boxes. The code I used sets
the names of the controls (the AddOne button, AddAll
button, etc.) on Open of the form, but for only one set
of list boxes. Can I reuse the code somehow or do I have
to copy and paste the code for as many controls as I have
and then change the names?

I hope this makes sense. Thanks, D.

Here's a sample of the on open code:

Call adhRegisterCtlNames(adhcSelectedList,
adhcAvailableList, _
adhcAddOneButton, adhcAddAllButton,
adhcDeleteOneButton, _
adhcDeleteAllButton)


#If USE_ARRAYS Then
' Fill in the arrays necessary for the two lists
' if you're using arrays.
SetupArrays
adhFillMultipikArray Me, varAvailable, varSelected
#Else
' Call the generic initialization code for using
a field.
Call adhFillMultipikField
(Me, "StationName", "tblStations")

#End If
 
Comment inline
I have a form that acts like a wizard where there are
list boxes with available choices and another list box
with choices they have moved over to it with command
buttons--the code works fine.

My question: I have a few available list boxes and a
complimentary selected list boxes. The code I used sets
the names of the controls (the AddOne button, AddAll
button, etc.) on Open of the form, but for only one set
of list boxes. Can I reuse the code somehow or do I have
to copy and paste the code for as many controls as I have
and then change the names?

I hope this makes sense. Thanks, D.

Here's a sample of the on open code:

Call adhRegisterCtlNames(adhcSelectedList,
adhcAvailableList, _
adhcAddOneButton, adhcAddAllButton,
adhcDeleteOneButton, _
adhcDeleteAllButton)


#If USE_ARRAYS Then
' Fill in the arrays necessary for the two lists
' if you're using arrays.
SetupArrays
adhFillMultipikArray Me, varAvailable, varSelected
#Else
' Call the generic initialization code for using
a field.
Call adhFillMultipikField
(Me, "StationName", "tblStations")

if you look at this function adhFillMultipikField - you will probably find
that it uses the second two parameters to be a dynamic query of the db, and
populates the controls on the form referred to in the first parameter with
the values from the correct fields and table (second two parameters).

if it is not doing precisely that it seems to be a good indicator of what
you need.
Marc
 
Back
Top