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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate form based on values from 2 other subforms

Status
Not open for further replies.

BakerUSMC

Technical User
May 24, 2003
96
US
Hello to all,

I have a form (frmsponsoringinfo) that has 2 fields that need to be populated from 2 subforms on another form.

frmassign contains 2 subforms:

subfrmsponsors (based off a query qryunassignedsponsors)
subfrmorphans (based off a query qryunassignedorphans)


I need the field Sponsor_ID from subfrmsponsors and the field Orphan_ID from subfrmorphans to populate on frmsponsoringinfo

The situation is: I have the form frmassign open and I need to match a sponsor and an orphan from the 2 different subforms. Once I have the sponsor and the orphan that I want, I need to open another form frmsponsoringinfo and have the fields Sponsor_ID and Orphan_ID populate with the ID's showing from the records I just found and matched.

So, once the form frmsponsoringinfo opens, the Sponsor_ID and Orphan_ID will have the ID's from records displayed on frmassign and I can then add more info for this match on frmsponsoring info.

I hope I explained this enough for you to understand... I've tried using:
Code:
 [Forms]![frm_sponsors_unassigned]![Sponsor ID]
on the query that frmsponsoringinfo is based off of. But its not working. I do keep the other form open for capture of the value of the field. But its still not working....

Please help!!!!
 
You may try this syntax:
Forms!frmassign!subfrmsponsors.Form!Sponsor_ID
Forms!frmassign!subfrmorphans.Form!Orphan_ID

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

Thanks for your reply... I have tried using ur version as follows:

[Forms]![frm_assign]![frm_sponsors_unassigned].[Form]![Sponsor ID]

[Forms]![frm_assign]![frm_orphans_unassigned].[Form]![orphans.Orphan ID]


But its still not working... please let me know what's wrong... Thanks!!!!
 
The syntax is:
[Forms]![name of mainform]![name of subform control].Form![name of control]
Have a look here:

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for your help... I got it working. I put the code in VBA instead of the query... much more simple... :)

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top