Disable Text Boxes (Access 2003)

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

Guest

How do I disable Text Boxes on a form, says, when a "Yes/No" checkbox is
checked/undchecked? How would I code it? Thanks.

Appreciate all the help I've received in the past months!

Chai
 
Chai

In the AfterUpdate event for the checkbox, add something like (your syntax
may vary):

Me.txtYourTextBoxName.Enabled = (Me.chkYourCheckBox = True)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Something is not working right here. This is what I have:

Me.[TextBox1].Enabled = Me.[CheckBox] = True

I want [TextBox1] disabled when [CheckBox1] is checked or true.

ERROR IS:
"Data member not found" for [CheckBox].
 
Chai

If you copied my suggestion exactly, it won't work for you! I used "dummy"
names to show the example -- you need to substitute your own control names.

Also, you might want to have parentheses around the "right side of the
equation.

Regards

Jeff Boyce
Microsoft Office/Access MVP


Chai said:
Something is not working right here. This is what I have:

Me.[TextBox1].Enabled = Me.[CheckBox] = True

I want [TextBox1] disabled when [CheckBox1] is checked or true.

ERROR IS:
"Data member not found" for [CheckBox].



Jeff Boyce said:
Chai

In the AfterUpdate event for the checkbox, add something like (your
syntax
may vary):

Me.txtYourTextBoxName.Enabled = (Me.chkYourCheckBox = True)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Me.[Fine_#4_WtRet].Enabled = Me.[FGradeCheckBox] = True

[Fine_#4_WtRet] and [FGradeCheckBox] are from a query. Still doesn't work.

It doesn't like [FGradeCheckBox].
It says data member not found for [FGradeCheckBox].

Thanks.

Jeff Boyce said:
Chai

If you copied my suggestion exactly, it won't work for you! I used "dummy"
names to show the example -- you need to substitute your own control names.

Also, you might want to have parentheses around the "right side of the
equation.

Regards

Jeff Boyce
Microsoft Office/Access MVP


Chai said:
Something is not working right here. This is what I have:

Me.[TextBox1].Enabled = Me.[CheckBox] = True

I want [TextBox1] disabled when [CheckBox1] is checked or true.

ERROR IS:
"Data member not found" for [CheckBox].



Jeff Boyce said:
Chai

In the AfterUpdate event for the checkbox, add something like (your
syntax
may vary):

Me.txtYourTextBoxName.Enabled = (Me.chkYourCheckBox = True)

Regards

Jeff Boyce
Microsoft Office/Access MVP


How do I disable Text Boxes on a form, says, when a "Yes/No" checkbox
is
checked/undchecked? How would I code it? Thanks.

Appreciate all the help I've received in the past months!

Chai
 
When Access says it can't find something, it usually means there's a
spelling error. Re-check your spelling.

I guess I'm confused ... I thought, since you posted in the .forms
newsgroup, that you are working in a form, in design mode. You mention that
the values are from a query. If you don't have the values showing in
controls on the form, what is it that you are trying to enable/disable?

If [Fine_#4_WtRet] is NOT the name of a control on your form, you won't be
able to use .Enabled.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Chai said:
Me.[Fine_#4_WtRet].Enabled = Me.[FGradeCheckBox] = True

[Fine_#4_WtRet] and [FGradeCheckBox] are from a query. Still doesn't work.

It doesn't like [FGradeCheckBox].
It says data member not found for [FGradeCheckBox].

Thanks.

Jeff Boyce said:
Chai

If you copied my suggestion exactly, it won't work for you! I used
"dummy"
names to show the example -- you need to substitute your own control
names.

Also, you might want to have parentheses around the "right side of the
equation.

Regards

Jeff Boyce
Microsoft Office/Access MVP


Chai said:
Something is not working right here. This is what I have:

Me.[TextBox1].Enabled = Me.[CheckBox] = True

I want [TextBox1] disabled when [CheckBox1] is checked or true.

ERROR IS:
"Data member not found" for [CheckBox].



:

Chai

In the AfterUpdate event for the checkbox, add something like (your
syntax
may vary):

Me.txtYourTextBoxName.Enabled = (Me.chkYourCheckBox = True)

Regards

Jeff Boyce
Microsoft Office/Access MVP


How do I disable Text Boxes on a form, says, when a "Yes/No"
checkbox
is
checked/undchecked? How would I code it? Thanks.

Appreciate all the help I've received in the past months!

Chai
 
Okay I got it. Yes, I am working in the design view of a form; sorry for the
confusion. What I was trying to enable/disable is a Text Box name
[FineWtRetained_No4] when [FGradeCheckBox] is checked/unchecked. The reason
why I was getting the errors was that I used the Text Box's control source
in the coding instead of the Text Box name. For example:

I had this before:
Me.[Fine_#4_WtRet].Enabled = (Me.[FGradeCheckBox] = True)
[Fine_#4_WtRet] is a data control source

This is what I have now and it works:
Me.[FineWtRetained_No4].Enabled = (Me.[FGradeCheckBox] = True)
[FineWtRetained_No4] is the Text Box name

I appreciate your patience.

Jeff Boyce said:
When Access says it can't find something, it usually means there's a
spelling error. Re-check your spelling.

I guess I'm confused ... I thought, since you posted in the .forms
newsgroup, that you are working in a form, in design mode. You mention that
the values are from a query. If you don't have the values showing in
controls on the form, what is it that you are trying to enable/disable?

If [Fine_#4_WtRet] is NOT the name of a control on your form, you won't be
able to use .Enabled.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Chai said:
Me.[Fine_#4_WtRet].Enabled = Me.[FGradeCheckBox] = True

[Fine_#4_WtRet] and [FGradeCheckBox] are from a query. Still doesn't work.

It doesn't like [FGradeCheckBox].
It says data member not found for [FGradeCheckBox].

Thanks.

Jeff Boyce said:
Chai

If you copied my suggestion exactly, it won't work for you! I used
"dummy"
names to show the example -- you need to substitute your own control
names.

Also, you might want to have parentheses around the "right side of the
equation.

Regards

Jeff Boyce
Microsoft Office/Access MVP


Something is not working right here. This is what I have:

Me.[TextBox1].Enabled = Me.[CheckBox] = True

I want [TextBox1] disabled when [CheckBox1] is checked or true.

ERROR IS:
"Data member not found" for [CheckBox].



:

Chai

In the AfterUpdate event for the checkbox, add something like (your
syntax
may vary):

Me.txtYourTextBoxName.Enabled = (Me.chkYourCheckBox = True)

Regards

Jeff Boyce
Microsoft Office/Access MVP


How do I disable Text Boxes on a form, says, when a "Yes/No"
checkbox
is
checked/undchecked? How would I code it? Thanks.

Appreciate all the help I've received in the past months!

Chai
 
Back
Top