Dialogue Parameter for ListBox or ComboBox
Hi
Can I've the complete code please and steps
I've a combo box . showing all the Regions which I like to select but ,It only allow me to select one.
firstly does the ComboBox allow to select Multiple values If Yes please adivse How ?
If not I can ListBox but can I've the code with the choice if the user can select 'All Regions' or 'Specific'
Many thanks
Can I've the complete code please and steps
I've a combo box . showing all the Regions which I like to select but ,It only allow me to select one.
firstly does the ComboBox allow to select Multiple values If Yes please adivse How ?
If not I can ListBox but can I've the code with the choice if the user can select 'All Regions' or 'Specific'
The following is the legacy code where if the user select 'All region' (AllCompanyRadioButton) it use hard code values but ELSE select multiple values and its work fine shown below which is , appreciate if any simple code for thisIf RegionRadioButton.Checked = True Then
i = RegionNameComboBox.SelectedIndex
RegionID = RegionIDComboBox.Items.Item(i)
MsgBox(RegionID)
Report.SetParameterValue("RegionID", RegionID)
MsgBox("LastCheck",RegionID)
End IF
If AllCompanyRadioButton.Checked = True Then
Report.SetParameterValue("RegionsByte", "15,14,13,12,99,88,77......................")
Else
Dim RegionIDString As String = ""
Dim RegionDescString As String
Dim i As Integer
Dim x As Integer
Dim y As String
For i = 0 To (RegionListBox.SelectedItems.Count - 1)
x = RegionListBox.SelectedIndices(i)
y = RegionIDListBox.Items.Item(x)
If i = 0 Then
RegionDescString = RegionListBox.SelectedItems(i)
RegionIDString = y
Else
RegionDescString = RegionDescString & ", " & RegionListBox.SelectedItems(i)
RegionIDString = y & ", " & RegionIDString
End If
Next
Report.SetParameterValue("RegionsByte", RegionIDString)
Report.SetParameterValue("RegionsDescParam", RegionDescString)
'### END - Identifies which region codes have been selected then assigns corresponding
'### region ID, puts into a delimited string to pass back to SQL as parameter.
End If
Many thanks
Comments
Before Else
How can I avoid the hard coded values 15,,14..... and so on . As once the values added into Reference table it not good habbit to add into code as well?
hope make sense please feel free to ask any question if it doesn't make sense.
Many thanks
Farhan