I have continuous form and want a single button for
1) select All
2) deselect all
3) multiple selection
How it works:
A) by button ""Select/Deselect All"
B) by checking the Check box (multiple selection)
Specific record row selection (check box) also changes a value in another control.
I have code, working fine but there is one problem.
In the picture you can see, Yellow highlighted, the record which in edit mode does not change with the button, because if it is already true then will remain true or False with remain false.
I have attached Demo to understand better what I meant.
Meaning If record is already selected by checkbox, and I click deselect all. then that specific record is not deselected. AND vice versa
Code for Button
Check box code
Thanks
1) select All
2) deselect all
3) multiple selection
How it works:
A) by button ""Select/Deselect All"
B) by checking the Check box (multiple selection)
Specific record row selection (check box) also changes a value in another control.
I have code, working fine but there is one problem.
In the picture you can see, Yellow highlighted, the record which in edit mode does not change with the button, because if it is already true then will remain true or False with remain false.
I have attached Demo to understand better what I meant.
Meaning If record is already selected by checkbox, and I click deselect all. then that specific record is not deselected. AND vice versa
Code for Button
Code:
Private Sub btnSelect_Click()
Dim rst As Recordset, i As Integer
Set rst = Me.RecordsetClone
i = 0
rst.MoveFirst
Do While Not rst.EOF
i = i + 1
rst.Edit
If rst![SELECTION] Then
rst![SELECTION] = False
rst![Status] = "Pending"
Else
rst![SELECTION] = True
rst![Status] = "Approved"
End If
rst.Update
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
End Sub
Check box code
Code:
Private Sub SELECTION_Click()
If Me.SELECTION.Value = True Then
Me.Status.Value = "Approved"
Else
If Me.SELECTION.Value = False Then
Me.Status.Value = "Pending"
End If
End If
End Sub
Thanks