Auto - Text Box greyed out

  • Thread starter Thread starter Guy Hocking
  • Start date Start date
G

Guy Hocking

Hi there,

Apologies, i am new to Access and am without my books.

I have a form with 3 tick boxes, and 3 pairs of text boxes (6 in total).
I need that when 1 of the tick boxes is ticked, a pair of txt boxes get
greyed out, and vice versa. So that the 3 pairs of text boxes correspond to
the 3 tick boxes.

How do i do this?

Thanks in advance

--
GH

www.bradflack.com

Please remove ANTI and SPAM from my
email address before sending me an email.
 
Guy

For each checkbox, something like the following in the AfterUpdate event (of
the checkbox) -- warning: actual syntax may vary:

If Me!chkChkBox1 = True Then
Me!AssociatedTextBox1.Enabled = False
Me!AssociatedTextBox2.Enabled = False
Else
Me!AssociatedTextBox1.Enabled = True
Me!AssociatedTextBox2.Enabled = True
End If

And you'll need to call this code (for each checkbox) in your form's
OnCurrent event, so that a newly-loaded record has the checkbox/textbox
relationship set up correctly.
 
Thanks for the response.

Where exactly would the code you gave me go? in the afterupdate property or
in a RunCode macro?
I am new to access so i probs needs a bit more explaining

Sorry to be a pain.


--
GH

www.bradflack.com

Please remove ANTI and SPAM from my
email address before sending me an email.
 
Guy

Please re-read my response -- I mentioned adding the code into the
AfterUpdate event of the checkbox.
 
Back
Top