Glaswegian
03-18-2008, 05:28 AM
Hi again
I have a multi page userform with a variety of controls. Briefly, users complete certain fields, option buttons etc and data is transferred to a hidden sheet. Users can recall this data but cannot make any further amendments. To ensure they cannot amend any data I'm using this code, which works fine:
For Each ctl In frmMain.Controls
If Not TypeOf ctl Is MSForms.MultiPage Then
If Not ctl.Name Like "*Close*" Then
ctl.Object.Enabled = False
End If
End If
Next ctl
This ensures that several 'Close' command buttons are available to close the form.
However, disabling the controls makes the data slightly difficult to read. Is there a way to loop through and Lock the controls, rather than disable them? Would I need to loop through each control type - combobox, textbox optionbutton etc?
Thanks for any assistance or suggestions.
I have a multi page userform with a variety of controls. Briefly, users complete certain fields, option buttons etc and data is transferred to a hidden sheet. Users can recall this data but cannot make any further amendments. To ensure they cannot amend any data I'm using this code, which works fine:
For Each ctl In frmMain.Controls
If Not TypeOf ctl Is MSForms.MultiPage Then
If Not ctl.Name Like "*Close*" Then
ctl.Object.Enabled = False
End If
End If
Next ctl
This ensures that several 'Close' command buttons are available to close the form.
However, disabling the controls makes the data slightly difficult to read. Is there a way to loop through and Lock the controls, rather than disable them? Would I need to loop through each control type - combobox, textbox optionbutton etc?
Thanks for any assistance or suggestions.