lundi 6 janvier 2020

Framed checkbox values on multipages wont print to cells

[Example of my Form][1][1]: https://i.stack.imgur.com/aiiSW.png

I am not getting error messages, but my code doesnt print the checkbox values from Multipage(1) to (3) to the assigned cells and I cannot figure out why.

MultiPage1(0) prints as it's supposed to do.

I've used the exact same code structure for checkboxes not within a frame on those multipages and those work fine, so what am I missing here? I've made the Dim unique for checking the location of the colours on the side.

I've tried multiple approaches;

Me.Controls Me.MultiPage(1).Controls Me.MultiPage(1).frameM1Zij.Controls Me.frameM1Zij.Controls Unfortunately none of these seem to work for MultiPages(1) to (3).

Dim chk As Control, M1LocZij As String

For Each chk In Me.frameM1Zij.Controls
   If TypeName(chk) = "CheckBox" Then
   If chk.Object.GroupName = "M1LocZij" Then
               If chk.Value Then
            M1LocZij = IIf(M1LocZij <> "", M1LocZij & ", ", "") & chk.Caption
        End If
        End If
    End If
Next


'Pak Meeting 2 Locatie Zij
For Each chk In Me.MultiPage1(1).frameM2Zij.Controls
   If TypeName(chk) = "CheckBox" Then
   If chk.Object.GroupName = "M2LocZij" Then
               If chk.Value Then
            M2LocZij = IIf(M2LocZij <> "", M2LocZij & ", ", "") & chk.Caption
        End If
        End If
    End If
Next


'Pak Meeting 3 Locatie Zij
For Each chk In Me.MultiPage1(2).Controls
   If TypeName(chk) = "CheckBox" Then
   If chk.Object.GroupName = "M3LocZij" Then
               If chk.Value Then
            M3LocZij = IIf(M3LocZij <> "", M3LocZij & ", ", "") & chk.Caption
        End If
        End If
    End If
Next


'Pak Meeting 4 Locatie Zij
For Each chk In Me.frameM4Zij.Controls
   If TypeName(chk) = "CheckBox" Then
   If chk.Object.GroupName = "M4LocZij" Then
               If chk.Value Then
            M4LocZij = IIf(M4LocZij <> "", M4LocZij & ", ", "") & chk.Caption
        End If
        End If
    End If
Next```

'''
With ws 
.Cells(iRow, 20).Value = M1LocZij
.Cells(iRow, 29).Value = M2LocZij
.Cells(iRow, 38).Value = M3LocZij
.Cells(iRow, 47).Value = M4LocZij
End With
''' 





Aucun commentaire:

Enregistrer un commentaire