Subform controls help needed

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

Hi:
I have a details subform that lists continuous records.
I'd like to run code to make a particular text box be not
visible when a certain condition is true. I have the
code, I'm just not sure how to trigger it. I'd like the
code to run for each record displayed in the subform.
Example: If a particular field is null, then
me.text20.visible = False. So, some records will have
text20 visible and some will not, depending on whether the
condition is met. Thanks for any help,
-Rick
 
You have most of your code already written
On the forms After Update Event of Me.FieldName write something like this

If Me.FieldName.Value = Null Then
Me.text20.visible = False
Else
Me.text20l.visible = True
End If

If me.FieldName is a text datatype, then you have have to replace Null with
""
 
Rick,

Check out Conditional Formatting in the Format menu of Forms Design.

Rather than play with the Visible property (which will affect the
column/control in all rows in the subform) you could instead use
C.F. to adjust the Background / Foreground colours to render the control
selectively (in)visible.

On the downside, Conditional Formatting does have a bit of an impact on form
performance - not prohibitive but at least noticeable.

CD
 
Back
Top