Subform Null Values

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

I have a continuous subform that have a field that is bound to a subquery
column. Because of the need to be able to add records to the continuous
form, I change the record source of the sub form to include and sometimes
not include the sub query field.

Obviously, when my record source doesn't include the subquery column, I get
the #Name? error in the subform text box. I tried using the below code on
the on current event of the subform but it has no effect. Basically I'm look
for a way to change the subform text box to blank if the data isn't included
in the record source.

Any ideas?


CODE:
********************

Me.Text1.Visible = Not IsNull(Me.Text1)
 
Scott said:
I have a continuous subform that have a field that is bound to a subquery
column. Because of the need to be able to add records to the continuous
form, I change the record source of the sub form to include and sometimes
not include the sub query field.

Obviously, when my record source doesn't include the subquery column, I get
the #Name? error in the subform text box. I tried using the below code on
the on current event of the subform but it has no effect. Basically I'm look
for a way to change the subform text box to blank if the data isn't included
in the record source.

Me.Text1.Visible = Not IsNull(Me.Text1)

You can not set properties for indiviual rows in a
continuous or datasheet form. There is only one text box
and its properties are used for all rows.

You can get the visual effect you want by making the bound
text box invisible and using another text box with an
expression like:
=IIf(IsError(boundtextbox), Null, boundtextbox)
But, I think you might be better off constructing your query
in such a way to include the field as a constant instead of
leaving it out.
 
Back
Top