Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking a Subform to a Parent Form to an unbound control 1

Status
Not open for further replies.

zevw

MIS
Jul 3, 2001
697
US
I have a Form and a subform that are linked by a field called InvNo.

I want that the subform should display information even when the master form does not have any info. in the InvNo field.

I want to create a unbound control on the master form and enter a number and based on that number display the information the subform is that possible?

Code:
'instead of writing

Me![InvSubform].LinkChildFields = "InvNo"
Me![InvSubform].LinkMasterFields = "InvNo"

'I will write 

Me![InvSubform].LinkChildFields = "InvNo"
Me![InvSubform].LinkMasterFields = Me!NewInvNo
 
And what about this ?
Me![InvSubform].LinkMasterFields = "NewInvNo"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I did the following at interprets it as the field name that I am linking to:

Code:
If Nz(Me.InvNo, "") <> "" Then
   Me![InvSubform].LinkChildFields = "InvNo"
   Me![InvSubform].LinkMasterFields = "InvNo"
Else
   Me![InvSubform].LinkChildFields = "InvNo"
   Me![InvSubform].LinkMasterFields = "'" & Nz(Me!HdnInvNo, "") & "'"
End If

How can I get around this?
 
I suggested this:
Me![InvSubform].LinkMasterFields = "HdnInvNo"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV!

Your the man, I wrote my second post while you were writing yours. But I changed it to the way you wrote it and it works wonders.

Thanks for all your wisdom during the past year and I wish you a happy and healthy New Year;

William
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top