Valentino54
New member
- Local time
- Today, 20:38
- Joined
- Mar 30, 2020
- Messages
- 12
Hi all, here I am with my first question...
The idea is to have two listboxes (lstboxA and lstboxB) on a form. Both listboxes have two columns, where column one is a text field and the second column is a check box. In lstboxA, the checkbox's value is True, in lstBoxB, instead, is False.
By doubleclickingon a name on the lstboxA i would like to uncheck the check box and refresh both listboxes.
My code tells me the column number and its values but I dont know how to modify the value of the checkbox.
By executing it I get Runtime Error 451 and so I'm stuck in it. Below the code I started with, only for lstboxA at moment, not complete yet.
Many thanks for help.
Private Sub lstGiaInvitato_DblClick(Cancel As Integer)
Dim intNumColonne As Integer
Dim intI As Integer
Dim frmInvito As Form
Set frmInvito = Forms!frmInvito
If frmInvito!lstGiaInvitato.ItemsSelected.Count > 0 Then
' Selezione
intNumColonne = frmInvito!lstGiaInvitato.ColumnCount
For intI = 0 To intNumColonne - 1
Debug.Print frmInvito!lstGiaInvitato.Column(intI)
Next intI
End If
frmInvito!lstGiaInvitato.Column(intI) = False
Set frmInvito = Nothing
End Sub
The idea is to have two listboxes (lstboxA and lstboxB) on a form. Both listboxes have two columns, where column one is a text field and the second column is a check box. In lstboxA, the checkbox's value is True, in lstBoxB, instead, is False.
By doubleclickingon a name on the lstboxA i would like to uncheck the check box and refresh both listboxes.
My code tells me the column number and its values but I dont know how to modify the value of the checkbox.
By executing it I get Runtime Error 451 and so I'm stuck in it. Below the code I started with, only for lstboxA at moment, not complete yet.
Many thanks for help.
Private Sub lstGiaInvitato_DblClick(Cancel As Integer)
Dim intNumColonne As Integer
Dim intI As Integer
Dim frmInvito As Form
Set frmInvito = Forms!frmInvito
If frmInvito!lstGiaInvitato.ItemsSelected.Count > 0 Then
' Selezione
intNumColonne = frmInvito!lstGiaInvitato.ColumnCount
For intI = 0 To intNumColonne - 1
Debug.Print frmInvito!lstGiaInvitato.Column(intI)
Next intI
End If
frmInvito!lstGiaInvitato.Column(intI) = False
Set frmInvito = Nothing
End Sub