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

Master/detail form

Status
Not open for further replies.

ablackwe

Programmer
May 14, 2004
57
GB
I wonder if someone could help. I have created a VB6 Master/detail form that contains data from 2 sources (tblTable1 & tblTable2), however, there is no field that relates the two tables. The actual link is provided from a 3rd table, tblTable3. So the relationship should be as follows:

tbl1_ID1 to tbl2_ID1
then
tbl2_ID2 to tbl3_ID2

Makes sense(?)

The code I have would work if I could find a way of relating tblTable1 and tblTable2 via tblTable3

Current Code:
Recordset.Open "SHAPE {select * from tblTable1} AS ParentCMD APPEND ({select * from tblTable2} AS ChildCMD RELATE tbl1_ID1 TO tbl2_ID1) AS ChildCMD", db, adOpenStatic, adLockOptimistic

Hope someone can help me with this one
Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top