K
Katayon
Hi,
I have searched through all previous messages, and can not find this
specific answer. I think its pretty simple, but I just can't get it right.
I have a form, and the form has a command button to "Save" (i.e. Lock all
fields), and here is the code for it.
____________________________________
Private Sub SaveRecord_Click()
On Error GoTo Err_SaveRecord_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me!CMID.Locked = True
Me!ArchiveDate.Locked = True
Me!SCR.Locked = True
Me!Build.Locked = True
Me!CMID.Locked = True
Me!ComponentName.Locked = True
Me!Comments.Locked = True
Me!Provider.Locked = True
Exit_SaveRecord_Click:
Exit Sub
Err_SaveRecord_Click:
MsgBox Err.Description
Resume Exit_SaveRecord_Click
End Sub
___________________________
This works fine. But I can not figure out the code to lock the subfrom
(sbfrmItems) in the same manner as well.
I have tried things like: Me!sbfrmItems.Form.Locked = True
and I get an error saying "...can't find the field 'sbfrmItems' referred to
in your expression."
Can someone please tell me what is the proper code for locking a subform,
persistant to the way I am locking individual fields (i.e. textboxes,
drop-downs...).
Thanks in advance!
I have searched through all previous messages, and can not find this
specific answer. I think its pretty simple, but I just can't get it right.
I have a form, and the form has a command button to "Save" (i.e. Lock all
fields), and here is the code for it.
____________________________________
Private Sub SaveRecord_Click()
On Error GoTo Err_SaveRecord_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me!CMID.Locked = True
Me!ArchiveDate.Locked = True
Me!SCR.Locked = True
Me!Build.Locked = True
Me!CMID.Locked = True
Me!ComponentName.Locked = True
Me!Comments.Locked = True
Me!Provider.Locked = True
Exit_SaveRecord_Click:
Exit Sub
Err_SaveRecord_Click:
MsgBox Err.Description
Resume Exit_SaveRecord_Click
End Sub
___________________________
This works fine. But I can not figure out the code to lock the subfrom
(sbfrmItems) in the same manner as well.
I have tried things like: Me!sbfrmItems.Form.Locked = True
and I get an error saying "...can't find the field 'sbfrmItems' referred to
in your expression."
Can someone please tell me what is the proper code for locking a subform,
persistant to the way I am locking individual fields (i.e. textboxes,
drop-downs...).
Thanks in advance!