I have this on the OnOpen Event of a form but it doesn't seem to be
working. Any suggestions?
If Forms!Sales!Text140 = 1 Then
Me.Text87.Visible = True
Me.Text89.Visible = True
Me.Text91.Visible = True
Else
Me.Text142.Visible = True
Me.Text144.Visible = True
Me.Text145.Visible = True
End If
Thanks
DS
Doesn't seem to be working may have some meaning to you, but it really
doesn't tell us anything. Try and be a bit more specific next time.
The Open event is too early in the form opening process.
Place your code in the Form's Load event instead.
Is the form you have this code in the 'Sales' form?
You can use If Me!Text140 = 1 then
otherwise use your Forms!Sales!Text140 syntax.
Don't you want to toggle the 2 groups so that if one group is Visible
the other is not?
If Me!Text140 = 1 Then
Me.Text87.Visible = True
Me.Text89.Visible = True
Me.Text91.Visible = True
Me.Text142.Visible = False
Me.Text144.Visible = False
Me.Text145.Visible = False
Else
Me.Text87.Visible = False
Me.Text89.Visible = False
Me.Text91.Visible = False
Me.Text142.Visible = True
Me.Text144.Visible = True
Me.Text145.Visible = True
End If