a macro for preventing the entering of data

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

Guest

I have created an Access form that has 30 questions and I want to learn how
to make it so that if you answer “yes†to let’s say the first question, that
some of the other 29 questions will change shade and you won’t be able to
enter any values in those questions. Maybe this is a macro but I am not sure
how to do it…. Can you help?


Thanks

Sincerely,
 
In the Click Event of the first question object, you would set the locked
and backcolor properties of the textboxes you wanted to disable.

Jim Evans
 
That sound like what you would do if you wanted to change the color and the
ability to enter values of the 1st question not the other 29??

Hadd0032
 
Hi

Jim's got it right

e.g.
Private Sub Text0_Exit(Cancel As Integer)
If UCase(Text0.Value) = "YES" Then
Text4.Locked = True
Text4.BackColor = RGB(255, 255, 0)
Else
Text4.Locked = False
Text4.BackColor = RGB(255, 255, 255)
End If
End Sub

where Text0 is the name of the first question's control and Text4 is the
name of another control that you want to alter.

Cheers
JulieD
 
this is what you want

Private Sub QuestionOne_Click()
me!QuestionTwo.Enabled = False
etc.
End Sub

This will "grey out" the questions that are not required.
 
Back
Top