I see a couple problems with the following code:
Code:
For b = 1 To 19
TB = frmLogBook.Controls("txt" & i).Value
Next b
First, you are looping on a variable "b", but you are using a variable "i" to get the textbox name. Second, all this logic will do, if it were to work, would be to continuously set the "TB" variable over and over again (19x) without doing anything with it.
You probably want to do something similar to the following:
Code:
For b = 1 To 19
TB = frmLogBook.Controls("txt" & b).Value
For Each chk In frmLogBook.Controls
If TypeName(chk) = "CheckBox"
If chk.Object.GroupName = "auxiliary" Then
If chk.Value = True Then
Aux = chk.Caption & " " & TB & vbNewLine
End If
End If
End If
Next chk
Next b
You may still have a problem with the following statement, unless you do something with it later, since it just resets the string over and over again:
Code:
Aux = chk.Caption & " " & TB & vbNewLine
Regards,
Ax