Disable fields on continuous subforms

mlai08

Registered User.
Local time
Today, 09:29
Joined
Dec 20, 2007
Messages
110
Hi there,

I have a continuous subform recording the information of various wireless products for an employee embedded in an employee main form. Please see screen shot enclosed.

There is a check box "BYOD/Personal" on the subform. I want to hide a number fields when this check box on independent record is checked. However, if I use the following codes, the changes apply to all records under that employee.

Private Sub BYOD/Personal_AfterUpdate()

If BYOD/Personal.Value = True then
Me.Provider.Enabled = False
Me.XXX.Enabled = False....etc.
Else
Me.Provider.Enabled = True
Me.XXX.Enabled = True....etc.
End If
End Sub

How can I just disable those fields on the subform of a specific record when the BYOD/Personal field for that record is checked?

I hope some expert in the forum can give me some guidance.

Thanks :(
 

Attachments

  • Wireless Product form.png
    Wireless Product form.png
    80.2 KB · Views: 106
Code like that doesn't work on a form. Try Conditional Formatting.
 
Thank you so much for your advice.

It works great with conditional formatting although it does not apply to check box. I might have to consider changing the check box to text box with dropdown options of "Yes" and "No".
 
Sorry, I thought you were disabling textboxes based on a checkbox.
 
No. You are right. I want to disable some controls including text boxes and a check box based on the BYOD/Personal check box. Changing that check box to Y/N dropdown combo box would get around it.

Thanks again for your help and quick response.
 
you will probably find the checkbox IS actually disabled, but the appearance wouldn't change.
 
Have you tried it Dave?
 
I think it's a matter of taste really.

Users get used to working with the ACTIVE row, and not worrying so much that the appearance of non-active rows changes as well, although aesthetically it isn't ideal

conditional formatting is fine too. You could put a small rectangle behind the checkbox, and change the appearance of that with conditional formatting.
 

Users who are viewing this thread

Back
Top Bottom