Codingn when no records in a subform

G

Guest

I have a form with a subform that displays more information about the record.
This relationship is a one to one master child relationship, but on occasion
there is no child so nothing gets displayed in the subform. My problem is
that I have an on current event procedure that runs through a bunch of if/if
else statements, one of these refrences an object in the subform, if there is
no data for the record in the subform I get "Runtime error '2427': You
entered an expression that has no value" is there a way to check if the
subform has data for this record or an if null equivilant statement to the
object or the entire subform?
 
G

Guest

You could use something like:
If Me.Recordset.RecordCount > 0 then

or you could put On Error Resume Next in front of the offending statement.

Barry
 
G

Guest

thank you I got it to work with: If Me.ODSubform.Form.Recordset.RecordCount >
0 Then
 

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