Hi,
I'm trying to create a little function which will check to see if the user has selected an option in an option array.
The idea is that I can call the function such as:
The ChkSel function would then loop through the option array to determine if any value is true therefore setting ChkSel to True.Code:If Not (ChkSel) Then ...
The code would be:
The above works just great. However, what I'm trying to accomplish now is to make it so that the above code can take a parameter in order to check various option arrays, not just one. So I thought I could do the following:Code:Private Function ChkSel() Dim i as Integer ChkSel = False For i = 0 to optSelect.Count - 1 If optSelect(i).Value = True Then _ ChkSel = True Next i End Function
The idea would be to call ChkSel and indicate which option array I want it to check such as: ChkSel(optSelect)Code:Private Function ChkSel(Control as String) Dim i as Integer For i = 0 to Control.Count - 1 If Control(i).Value = True Then _ ChkSel = True Next i End Function
But, the above doesn't seem to work as it gives me some errors.. I must be missing something...
Any help would be appreciated.. (By the way, don't suggest using flags in the click event of the array because I don't want to do that for various reason.. I just want to make the above code work..)
Thanks,
Dan




Reply With Quote