Change Field Lock Property - subform on Tab Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro that uses "SetValue" to lock or unlock selected fields on a
form and subform that works just fine. If I apply this same macro strategy
to a form with a tab control with two tabs, the second of which holds a
subform, I can lock or unlock all the fields on the main form and the first
tab of the tab control, but cannot unlock the subform fields on the second
tab. How can I do this? (I don't know VB.)

Thanks!
 
Not sure but if you locate it similar to this it should unlock it.

Forms!MainFormName!SubFormName.Form.FieldName.SetFocus or Lock or Unlock =
TRUE or something lilke this should get it for you.

If you have a subform on your subform add the nested subform before the word
..Form and it should find it ok too...

Good Luck...

Dwgiht
 
cannot unlock the subform fields on the second tab

what happens when you run the macro? do you get an error message? or do the
subform controls simply not react to the SetValue action(s)?

what syntax are you using on the first tab page? and what syntax are you
using on the second tab page?
 
When I run the macro, I get no error, the action simply does not execute the
portion for the second page of the tab control. for the subform on the
second page of the tab control I am using Forms![main
form]![subform]![field].[Locked] and using SetValue. This works if the
subform is not on a tab control. All the fields on the first page of the tab
control are main form fields, not subform fields; and I'm using Forms![main
form]![field].[Locked] with SetValue and it works.
 
since you say the syntax works on the subform when it's not on the tab, then
we know your syntax is correct. i don't know why having the subform control
on a tab page is making a difference - it shouldn't. at any rate, you can
also set the value of the Locked property in code. assuming that you're
running the code from the main form's module (not the subform's), use

Me![subform]![field].[Locked] = True

hth


KT said:
When I run the macro, I get no error, the action simply does not execute the
portion for the second page of the tab control. for the subform on the
second page of the tab control I am using Forms![main
form]![subform]![field].[Locked] and using SetValue. This works if the
subform is not on a tab control. All the fields on the first page of the tab
control are main form fields, not subform fields; and I'm using Forms![main
form]![field].[Locked] with SetValue and it works.

tina said:
what happens when you run the macro? do you get an error message? or do the
subform controls simply not react to the SetValue action(s)?

what syntax are you using on the first tab page? and what syntax are you
using on the second tab page?
 
Back
Top