changing subform visibility

nebraska52

New member
Local time
Today, 06:47
Joined
Dec 27, 2013
Messages
1
Hello,
I have a form containing client demographics. One of the fields is the DateOfBirth. I would like to control the visibility of a subform based on this DateOfBirth field.

I have tried using the code below:

Private Sub Form_Current()
If DateOfBirth > 11 / 11 / 1994 Then subEligibility.Visible = False
End Sub

This works when the form is opened for the first record, but the visibility does not change as I scroll through the rest of the records.
Thank you.
 
Sounds like you need to put the code in the "Update Form" module as well. Make sure that you actually move from one record to another when you scroll, otherwise the update won't register, as the record will not have saved since the change to DOB.
 
I think you need to be looking at conditional formatting for the subEligibility control. Although you cannot set its visible property you can set the forecolor to the same as the back colour which effectively hides it - or you can disable it
 
You can format a subform control with Conditional Formatting?
 

Users who are viewing this thread

Back
Top Bottom