HasData on a form?

  • Thread starter Thread starter Opal
  • Start date Start date
O

Opal

I am running Access 2003 and have
a subform based on a query. I have
a textbox on the main form that shows
the value in one of the textboxes on the
subform. If the query has no records,
I get #Error in my textbox on the main
form. How can I get the text box on
the main form to show zero if the query
has no records on the subform?
 
1st unbind the text box
then after the query
use

If Me.MySubform.Form.Recordset.RecordCount < 1 Then
me.MyTextBox= "No Records Found"
else
me.MyTextBox= [whatever it does now]
End If

to update the textbox
 
Opal said:
I am running Access 2003 and have
a subform based on a query. I have
a textbox on the main form that shows
the value in one of the textboxes on the
subform. If the query has no records,
I get #Error in my textbox on the main
form. How can I get the text box on
the main form to show zero if the query
has no records on the subform?


Keri Hardwick has posted a nice solution:

http://www.mvps.org/access/forms/frm0022.htm
Forms: #Error when the Subform has no records
 
Back
Top