Subform Null Values

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)
 
M

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top