tab control

C

Chris

Hello All.

I am using the tab control with 5 tabs and one subform on each tab. When
the user is using ther system I have locked all the controls so that he/she
does not accidently edit them. I have added an "edit" button to enable the
records.

on clicking the edit buitton I can unlock the controls on one subform but I
do not know how to unlock all the controls on all the subforms

Forms!FrmPersonalD.frmMainApp.Form!txttest.SetFocus
' I think it is the following line that needs to be changed
For Each ctl In Forms!FrmPersonalD.frmMainApp.Controls
Select Case ctl.ControlType
Case acComboBox, acListBox, acTextBox
If (ctl.Name <> "txtTest") Then
ctl.Locked = Not ctl.Locked
' toggling the visible property
End If
Case acSubform

End Select
Next ctl

Please help
 
W

Wayne Morgan

Would it be easier just to set the AllowEdits, AllowDeletions, and/or
AllowAdditions properties of the form(s)?
For Each ctl In Forms!FrmPersonalD.frmMainApp.Controls
Assuming that frmMainApp is the name of the subform control holding the
subform, not the name of the subform itself, try

For Each ctl In Forms!FrmPersonalD.frmMainApp.Form.Controls
or perhaps

For Each ctl In Me.frmMainApp.Form.Controls
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top