I have a string of values that I am extracting from a table ("1,2,5"). I also have 9 check boxes on a form. When the user loads the form I want to automatically "check" the checkbox that corresponds to the values in the string...see example
on load
StringValue = "1,4,5"
chk1, chk4, chk5 value = true
chk2, chk3, chk6, chk7, chk8, chk9 value = false
I am able to extract the string using DLookup() and split the string. My difficulty is getting the corresponding check-box assigned the true value. This can be a variable selection of any combination.
This is what I tried but it obviously didn't work
Code:
Const DenSelect As String = "1,4,5" 'This will be DLookup() in actual code
Dim strSelect() As String
Dim intCounter As Integer
strSelect = Split(DenSelect, ",")
For intCounter = LBound(strSelect()) To UBound(strSelect())
chkreason & strpart(intcounter).value = -1
' MsgBox strSelect(intCounter)
Next intCounter