set field to visible or invisible

sock

New member
Local time
Today, 07:02
Joined
Aug 17, 2009
Messages
4
Hi, I have a little problem. I would like one field called Risk_Assessment to be set to visible if Age is under 19 and set to invisible if over 19. Please can you help with the code and explain where I should put it. This is what I have done and it does not work:

Private Sub Risk_Assessment_BeforeUpdate(Cancel As Integer)
If Me.Age <= 19 Then
Me.Risk_Assessment.Visible = True
Else
Me.Risk_Assessment.Visible = False
End If
End Sub

Thanks
 
You will need to put this on the OnCurrent event of your form if it is a bound form. If unbound you will need to place just after the age field is either populated or updated.

David
 

Users who are viewing this thread

Back
Top Bottom