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

Looking for correct relationship for popupform

Status
Not open for further replies.

hayde

Technical User
Feb 16, 2005
10
0
0
US
I have an order form with the record source from tblOrders. I'm trying to create a popup form (from tblFaxes) where I can keep track of phone or fax information (such as date called, why called, response rec'd, etc.)related to a particular order. Most orders do not need to use this popup though. How do I setup the relationships for these tables? I keep getting all types of error messages depending on what I try.
 
Forms doesn't have relationship, tables have.

As you describe it, I'd say tblOrder on the 1 side, tblFaxes on the M side -> primary key from tblOrder becomes foreign key in tblFaxes.

A separate form is not linked in any way to another form, so what you probably need, is some means of assigning the primary key value from the current record in your form bound to the order table per each new record in your pop up form.

one could use the openargs to pass it, or for instance in the on current event of the form bound to the faxes table, pick up the primary key if it's a new record. Might look like this:

[tt]if me.newrecord then
me!txtFK.value = forms!frmNameOfOrderForm!txtPK.value
end if[/tt]

where txtFK is the control on the form bound to the faxes tables foreign key, and txtPK is the control bound to the primary key field on the order form.

Roy-Vidar
 
How are ya hayde . . . . .

Sounds like a [purple]One To Many[/purple] relationship from table Orders to your new table. Just pay attention to your relationship linking fields. Should be:

[tt][blue]Table Orders
************

[purple]YourOrderID PrimaryKey[/purple]

Table NewTable
**************

TrackingID PrimaryKey
[purple]YourOrderID ForeignKey to table Orders & same data type![/purple]
YourFields
[green]'[/green]
YourFields[/blue][/tt]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top