Auto - Text Box greyed out

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.
 
J

Jeff Boyce

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.
 
G

Guy Hocking

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.
 
J

Jeff Boyce

Guy

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

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