disable text box if combo box is not filled

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: WJ (anonymous_at_discussions.microsoft.com)
Date: 11/12/04


Date: Fri, 12 Nov 2004 07:22:26 -0800

Thanks for your reply!

But sorry I don't fully understand you. You mean to set
the "text box" to be disenabled, correct?

It works if I set the text box to be disabled. But
everytime I click on somewhere else, for example other
checkboxes, the text box would automatically enable itself
even if there was STILL nothing in the combo box above it.

So potentially, a user can put nothing in the combo, and
click somewhere else, and then enter something in the text
box.....

how can i solve this? maybe by writing some code?

thanks a lot.

>-----Original Message-----
>hi,
>try seting the combo box default setting to enabled =
>false in the combo box's property sheet.
>when the form is open the combo box is empty and the text
>box with by unenabled by default. if the use selects
>something from the combo box, it will be enabled
>programaticly.
>
>>-----Original Message-----
>>Please help me with this:
>>
>>I have a combo box "Client_Broker_Combo", and a text box
>>following it "Broker_Other_Fill_In". So if the user
>>selects "Other" from the combo box, then I want to
enable
>>the text box, so that the user can enter the broker name.
>>
>>But right now, if the user does not choose anything from
>>the combo box, the text box is still enabled. And I want
>>to disable the text box if the user chooses nothing from
>>the combo. I've tried "isEmpty", "isNull", but nothing
>>works. so please help...The following is the code I have:
>>
>>
>>
>>Private Sub Client_Broker_Combo_AfterUpdate()
>>
>>If Client_Broker_Combo <> "Other" Then
>>
>> Client_Broker_Other_Label.ForeColor = 8421504
>> Broker_Other_Fill_In.ForeColor = 8421504 'LAB
>> Broker_Other_Fill_In.Value = " " 'LAB
>> Broker_Other_Fill_In.Enabled = False
>>
>>
>> Else
>>
>> Client_Broker_Other_Label.ForeColor = QBColor(0)
>> Broker_Other_Fill_In.ForeColor = QBColor(0)
>> Broker_Other_Fill_In.Enabled = True 'LAB
>>
>>
>> End If
>>
>>
>>End Sub
>>.
>>
>.
>



Relevant Pages

  • Re: PropertyPage Communications
    ... Ron H wrote: ... One of the checkboxes on page 4 enables a feature on page 1. ... the operator has to close the property sheet and reopen it to see the effect. ... I would use a derived CPropertySheet class and use variables in this class to communicate between the pages. ...
    (microsoft.public.vc.mfc)
  • disable text box if combo box is not filled
    ... try seting the combo box default setting to enabled = ... false in the combo box's property sheet. ... when the form is open the combo box is empty and the text ... >End Sub ...
    (microsoft.public.access.formscoding)
  • RE: Mutually Exclusive Checkboxes and Counting the number of ticks in
    ... "spunkymuffmonkey" wrote: ... rows and fours columns in, each row has a question in the first column ... Mutually Exclusive Checkboxes and Counting the number of ticks in each column. ... I would love some help in writing a macro that counts the number of checks ...
    (microsoft.public.word.vba.general)
  • Writing an expression on query to select specific data
    ... like help in writing an expression that would show a field if that ... but would not show it if not ticked on the report. ... have created a database which allows a multitude of countries to be selected ... checkboxes on the report as to show which country/ies a company is presnce ...
    (microsoft.public.access.reports)
  • getting values of checkboxes.
    ... I have a problem - I have a list of checkboxes, ... Hmmmmm while writing this, I wonder whether I can use isset() - ... but just empty... ...
    (comp.lang.php)