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

Passing Data from Parent to Child Form

Status
Not open for further replies.

bostonfrog

Programmer
Jul 14, 2003
79
MX
Form2 (the many side of the relationship) opens from a command button on Form1 (the 1 side of the relationship) -- Thus when I press on the Add | Edit Records button from Form1, Form2 opens up on the linked criteria (e.g.,
Code:
"[ID] = '" & Me.ID & "'"
), and it correctly displays the person's name and ID number. One caveat though: When I am creating a new record, because there are 0 records in the child relationship, it will not display the person's name and ID until I've at least entered something into the form -- for example some text or a date in the form's fields. The data entry people find this visually problematic, because when a new (blank) form opens up, they'd like to immediately see displayed the client's name and ID before they type anything. Is this possible? Thanks.
-- Michel
 
Michel,

You could do the following....

When you click the Add/Edit button, first check the many table for any occurances of the relationship...if none exists, create a blank record in the many table. If any exist, ignore this. Then open the sub form.

****************************
Only two things are infinite, the universe and human stupidity,
and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Also you could try setting the Default Value of the ID number in Form2 to:

=[Forms]![Form1]![ID]

Repeat the above for the Client's Name field.

Bill
 
Another simple idea....

Add an unbound text box to the subform...hide the textbox that is currently bound to the [ID]....then open the subform with an openargument of the ID and put the openargs into the unbound box on the subform...

****************************
Only two things are infinite, the universe and human stupidity,
and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top