macro help needed (1 Viewer)

arage

Registered User.
Local time
Today, 00:19
Joined
Dec 30, 2000
Messages
537
Hi,
I haven’t been using macros in my project much but I think I need to in this case. My form is a pair of tab controls & when the user enters the form or updates the form so that a particular field is nonzero, I want I guess, a macro to run that’ll lock all the controls on the form. Cud someone mention which actions wud be appropriate? My problem is that there are many controls on my form and I want to grab all of them @ once and then disable them. Possible?
Thanks!
 

arage

Registered User.
Local time
Today, 00:19
Joined
Dec 30, 2000
Messages
537
i know i was asking for macro help, but is this vba code a step in the right direction? in it i set ctrlName to the 1st control name on the tab to disable.

then the tab index is set & disable for 32 lopps b/c there are 32 controls. i hope you folks can see what i'm doing, ea loop iteration shud yield a different control name along with its proper index value when disabling.
thanks!

Private Sub LockTab1()

Dim CtrlName As Integer
Dim x As Integer

CtrlName = cmbType.Name

For x = 1 To 32
CtrlName.TabIndex = x
CtrlName.Enabled = False
Next x

End Sub
 

Users who are viewing this thread

Top Bottom