Hello All,
I have a form frmDTRPrep with a subform frmDTRPick. On DTRPick there is a field Pkgd which is a checkbox. The idea is that users pick the boxes they want to add to a shipping request. Works fine as is, but for the times when there are too many boxes to just click on one by one, I want to add controls on the main form to check/uncheck all.
Here is what I have so far for the de-select all:
But every time I click the button I get the error that Access can't find the field "sfmDTRPick". Clearly, I'm not writing out the call for the subform correctly, but darned if I know what I'm doing wrong.
Ideally, I'd like the button to be able to select/de-select all, but having one less button is not as important to me as getting the thing to work correctly.
I have a form frmDTRPrep with a subform frmDTRPick. On DTRPick there is a field Pkgd which is a checkbox. The idea is that users pick the boxes they want to add to a shipping request. Works fine as is, but for the times when there are too many boxes to just click on one by one, I want to add controls on the main form to check/uncheck all.
Here is what I have so far for the de-select all:
Code:
Private Sub Command10_Click()
Dim rs As DAO.Recordset
Set rs = Forms!frmDTRPrep!sfmDTRPick.Form.RecordsetClone
Do While Not rs.EOF
rs.Edit
rs!Pkgd = False
rs.Update
rs.MoveNext
Loop
Set rs = Nothing
End Sub
Ideally, I'd like the button to be able to select/de-select all, but having one less button is not as important to me as getting the thing to work correctly.