subform substitution follow-up

V

Virgil Layne

The code I gave in the previous post was incorrect.
Here's the correct version that I tried.
Private Sub Form_Current()
If IsNull
(Me.fsubFill.Form.RecordsetClone.RecordCount) Then
Me.fsubFill.SourceObject = "fsub2"
Me.fsubFill.LinkMasterFields
= "IDNumber" 'primary key
Me.fsubFill.LinkChildFields = "IDNumber"
Else
Me.fsubFill.SourceObject = "fsub1"
Me.fsubFill.LinkMasterFields = "IDNumber"
Me.fsubFill.LinkChildFields = "IDNumber"
End If

As info, I'm trying to substitute another subform when the
default subform has no records. Access does not load the
second form using this code, just makes the first form
turn blank.
 

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