Sorry my bad, form is not a subform, but is called by a cmd btn with code: DoCmd.OpenForm Form2, , , stLinkCriteria
Even with DoCmd.OpenForm Form2, , acReadOnly, stLinkCriteria form2 allows editing. ??????
I tried your code, doesn't work, but locking each textbox will. So I used this code to try to cycle through the text-boxes:
Dim ctl As Control
If Me.ckQAStatus = True Then
If ctl.contoltype = acTextBox Then
For Each ctl In Me.Controls
ctl.Locked = True
Next
End If
End if
or based on something I saw on-line I used this code:
Dim ctl As Control
If Me.ckQAStatus = True Then
For Each crl In Me.Controls
With ctl
Select Case .ControlType
Case acTextBox
ctl.Locked = True
End Select
End With
Next
end if
Either way I got a "Run-time error 91, Object variable or With block variable not set" in each case the debug stops on the line containing '.ControlType'.
Am I missing something or do these code snippets not tell the whole story? Any thoughts?