Tick Box (1 Viewer)

bgcogen

Registered User.
Local time
Today, 19:25
Joined
Apr 19, 2002
Messages
61
Hi all!
This is my boggle: Basically I have a form that take in a bunch of data into a table, grand.

There is a tick box on the form. The user ticks the tick box is there is no information to be entered in the "Details"part.

I want the form to kind-of gray out the "Details" part of the form so the user can no longer enter dtaa into this section.

Does anyone know if such a thing is possible in Access???

Thanks for any help :)

D
 

TheOx2K

Registered User.
Local time
Today, 19:25
Joined
Feb 19, 2002
Messages
28
In the properties for the tick box add an event on click. Code builder. In the code type

if nameofdetailtextbox = true

nameofdetailtextbox.enabled = false

else

nameofdetailtextbox.enabled = true

end if


Hope this helps.:)
 

Rich@ITTC

Registered User.
Local time
Today, 19:25
Joined
Jul 13, 2000
Messages
237
Hi

Yes I am sure you can do what you want ... with a bit of VB(A) coding.

You will have to put code in the 'After Update' event of the tick box that wll make the 'Details' part become unavailable (this will mean making 'whatever.enabled=false'). Naturally you will have to check via an if/esle/then section as to whether the tick box is selected or not.

Also you'll need to code this into 'On Current' for the Form property, so each time you move to a new record the coding is run and the 'Details' part is made enabled or not.

To give more advice you'll need to specify version of Access, names of fields, controls, etc and give the people on this site more information on 'Details' - is this a subform, a series of controls, etc?

HTH

Rich
 

Fizzio

Chief Torturer
Local time
Today, 19:25
Joined
Feb 21, 2002
Messages
1,885
On the AfterUpdate event of the tick box,

If Me.NameOfTickBox = True then
Me.NameOfDetailControl.Enabled = False
Else Me.NameOfDetailControl.Enabled = True
End If

To be more comprehensive, place this code in the On_Current event of the form also.

Bugger - everyone must be able to type faster than me!:(
 
Last edited:

bgcogen

Registered User.
Local time
Today, 19:25
Joined
Apr 19, 2002
Messages
61
Loosing focus

Hi again.
Ok, so I did what you guys said and it works fine. But the only problem is that when the form opens the "Details" part is "active". Is there anyway of having the "Details" part "greyed-out" or inactive by default when the form is first opened????


Thanks for you help :)
D
 

Rich@ITTC

Registered User.
Local time
Today, 19:25
Joined
Jul 13, 2000
Messages
237
Hi again

Just put the same VBA code in the Forms 'On Open' property.

That should sort it.

HTH

Rich
 

indesisiv

Access - What's that?
Local time
Today, 19:25
Joined
Jun 13, 2002
Messages
265
Tick box

To start with the box greyed out ... you can always just set the property as you set the form. Look at the properties and set the enabled property to false.
You can then enable it at run time using the codes given above.

Hope this helps
 

Users who are viewing this thread

Top Bottom