Enabling a control from a cbo selection

G

Guest

I am trying to enable a text box on a form if I select cancel from a combo
box, How do I do that. (the name of the combo box is status which includes
pending, cancel, in progress. Would like to enable cxclReason if i select
cancel)

The following is what I have in my combox after update procedure

Private Sub Status_AfterUpdate()
if Status.Value = Cancel Then
CxclReason.Enabled = True
Else
CxclReason.Enabled = False

End If
End Sub
 
G

Guest

Hi.
I am trying to enable a text box on a form if I select cancel from a combo
box, How do I do that.

Try:

If (Me!Status.Column(1) = "cancel") Then
Me!CxclReason.Enabled = True
Else
Me!CxclReason.Enabled = False
End If

.... where the number in the column's parentheses is the ordinal number of
the column containing the word "cancel." Remember that the Column Collection
is zero-based, so the above example would check the second column. If your
combo box only has one column (the zeroth column), then use 0.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.
 
G

Guest

Thanks that worked!

'69 Camaro said:
Hi.


Try:

If (Me!Status.Column(1) = "cancel") Then
Me!CxclReason.Enabled = True
Else
Me!CxclReason.Enabled = False
End If

... where the number in the column's parentheses is the ordinal number of
the column containing the word "cancel." Remember that the Column Collection
is zero-based, so the above example would check the second column. If your
combo box only has one column (the zeroth column), then use 0.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top