Disable text box

jsic1210

Registered User.
Local time
Today, 13:52
Joined
Feb 29, 2012
Messages
188
Okay, I am losing my mind here. I have a control that I want enabled/disabled based on other fields' values, both on Form_Current and [control]_AfterUpdate. In some instances, it works. It seems to be when the subform field Status = "Terminated" that it doesn't.
My code:
Code:
' enable/disable fee notice
If Me.PricePlan = "No Fees" Or Me.PricePlan = "n/a" Or Me.Agreement = "NDA" Then
    Me.FeeIncreaseNotice.Enabled = False
Else
    Me.FeeIncreaseNotice.Enabled = True
End If
I thought maybe it was being undone when another subform, a sub-subform or the parent form was loading, but I couldn't find anywhere else in my code that this field was affected. I put it at the very end of the Form_Current event, but that didn't work. Then I just added a command button with the code:
Code:
Me.FeeIncreaseNotice.Enabled = False
Clicking that STILL DIDN'T WORK! I'm wondering if anyone knows of some field setting that may be affecting this.

Thanks!
 
all depends on where your code is - probably needs to be in your Priceplan afterupdate event and your form current event
 
It's in my On Current, PricePlan AfterUpdate, and Agreement AfterUpdate.
 
can you please check the "name" of your control on design view.
 
I considered this, because it's the only thing that makes sense. Originally, the control name was FeeNotice, but the control source was FeeIncreaseNotice. I thought that's what was causing the problem, so I changed the control name to FeeIncreaseNotice to match the control source. Still no luck.
 
ok, next step, debug, see if your code is running, press F9 on the code that enable/disable your control. run your form. if you got lucky and got in debug mode then your in the right house. press F8 to step through the code. if you are not placed in debug mode, you placed the code in the wrong form/subform.
 
I've already tried stepping through the code. It's definitely on the right object.
 
More on the stepping through: it worked when I stepped through. Not sure where it's breaking. But even if I have the default setting to disabled, it ends up enabled. So it would seem somewhere in my code, there is
Code:
FeeIncreaseNotice.Enabled = True[\CODE]
But again, I've stepped through (including the loading of other sub-forms), and I can't find it.
 

Users who are viewing this thread

Back
Top Bottom