Talk About Network

Google





Software > Access Forms > Re: Active, Ina...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 6 Topic 44632 of 46786
Post > Topic >>

Re: Active, Inactive textboxes

by "Douglas J. Steele" <NOSPAM_djsteele@[EMAIL PROTECTED] > Aug 7, 2008 at 05:18 PM

In the form's Current event, set the Enabled property for all of the 
relevant controls to False.

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"AccessDB" <scl1974@[EMAIL PROTECTED]
> wrote in message 
news:b3302381-1685-454a-be7c-0d0a6287db01@[EMAIL PROTECTED]
 Aug 7, 2:38 pm, "Douglas J. Steele"
<NOSPAM_djsteele@[EMAIL PROTECTED]
> wrote:
> Piet's code assumes you have two text boxes (one named txt1, one named 
> txt2)
> and that you want txt1 to be enabled when the check box (named
MyCheckBox)
> is checked and disabled when it's not checked. and that you want txt2 to

> be
> disabled when the check box is not checked and enabled with it is.
Change
> the names of MyCheckBox, txt1 and txt2 as appropriate.
>
> However, there's a mistake in the code.
>
> It should simply be
>
> Sub MyCheckBox_AfterUpdate()
> Me.txt1.Enabled=Me.MyCheckBox
> Me.txt2.Enabled=Not Me.MyCheckBox
> End Sub
>
> Check boxes are either True or False. There's no reason for a variable 
> named
> Checked.
>
> --
> Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
> (no e-mails, please!)
>
> "AccessDB" <scl1...@[EMAIL PROTECTED]
> wrote in message
>
>
news:72c193d1-430e-43cb-8041-30284a43e569@[EMAIL PROTECTED]
>
> > in the afterupdate of your checkbox, set the Enabled property of the
> > relevant textboxes.
>
> > Sub MyCheckBox_AfterUpdate()
> > Me.txt1.Enabled=(MyCheckBox=Checked)
> > Me.txt2.Enabled=Not (MyCheckBox=Checked)
> > End Sub
>
> I'm new to coding so in your code Me.txt1.Enabled=(MycheckBox=Checked)
> - is the txt1 the name of my textbox on my form? If so, then what is
> the second line of code for?

Thank you it works. But how do I have the questions below the Yes/No
question to be Disabled/Inactive until I pick Yes.
Example: First question - Do you have any any siblings?
              Second question - How many
I want the "How Many" question to be Disabled/Inactive until Yes is
picked.
Here is my actual code so far:
Sub txtIs_AfterUpdate()
  Me.txtApplication.Enabled = Me.txtIs
End Sub

What do I need in addition to the code to make this work.
 




 6 Posts in Topic:
Active, Inactive textboxes
AccessDB <scl1974@[EMA  2008-08-06 12:08:09 
Re: Active, Inactive textboxes
Piet Linden <PieterLin  2008-08-06 14:36:44 
Re: Active, Inactive textboxes
AccessDB <scl1974@[EMA  2008-08-07 10:38:31 
Re: Active, Inactive textboxes
"Douglas J. Steele&q  2008-08-07 15:38:09 
Re: Active, Inactive textboxes
AccessDB <scl1974@[EMA  2008-08-07 12:54:23 
Re: Active, Inactive textboxes
"Douglas J. Steele&q  2008-08-07 17:18:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 14:56:37 PST 2009.