Access fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How to..? I want a field in a form to available/not available contingent on
data in other fields. For example, if Field 1 is a checked checkbox, then I
want Field 2 to be active for data entry, but if Field 1 is not checked, then
I want Field 2 to be grayed out and not available for data entry. Any ideas?
Thanks.
 
Did you try searching for your answer? This is posted almost every single
day...


I found this when I searched google...


The simplest way is to put some code that checks for an entry in the
after update event for your check box. Something like this will do the
trick.

Private Sub FieldA_AfterUpdate()
If Me.FieldA = True Then
Me.FieldB.Enabled = True
End If
End Sub


You will need to change the 'enabled' property for FieldB to 'No' and
also change the default value of your check box to false. Don't forget
to change the default value in the table as well.
 
A similar solution a bit further down in the search....


On the click event of the check box:


mycontrol.enable = mycheckbox
myothercontrol.enable = mycheckbox


if mycheckbox is unchecked(false), the other controls will be enabled=false.
If
mycheckbox is checked (true) the other controls will be enabled=true.


you may want to set the controls to enabled=false on the properties of each
control.
 
Thank you, Rick B. I tried several Google searches, but couldn't find
exactly what I needed. It could be that I didn't word the search "just
right". Anyhoo.. your suggestions look like they will work great. Thank you
so much for your quick response. Very much appreciated - Colleen B.
 
Back
Top