G
Guest
Hello,
What is the difference/advantages either way between defining join properties "on the fly" in the Design Query View vs. permanent definition under the Tool-Relationships menu procedure?
It seems that I can define them on the fly using the following code without any setting of primary keys (equivalent to doing so in the Design query view), while setting of primary keys is necessary for permanent definition under the Tool-Relationships menu procedure. Is there any danger in not setting the primary keys but just doing the join and make table (later export table) on the fly? If there is no danger, why ever bother with the Tools-Relationships menu procedure?
Dim strSQL As String
strSQL = "SELECT zmax2.*, rooting2.* " & _
"INTO temp " & _
"FROM zmax2 LEFT OUTER JOIN rooting2 " & _
"ON zmax2.musym = rooting2.musym"
'Turn off warning message.
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
'Re-enable warning message
DoCmd.SetWarnings True
RichardA
What is the difference/advantages either way between defining join properties "on the fly" in the Design Query View vs. permanent definition under the Tool-Relationships menu procedure?
It seems that I can define them on the fly using the following code without any setting of primary keys (equivalent to doing so in the Design query view), while setting of primary keys is necessary for permanent definition under the Tool-Relationships menu procedure. Is there any danger in not setting the primary keys but just doing the join and make table (later export table) on the fly? If there is no danger, why ever bother with the Tools-Relationships menu procedure?
Dim strSQL As String
strSQL = "SELECT zmax2.*, rooting2.* " & _
"INTO temp " & _
"FROM zmax2 LEFT OUTER JOIN rooting2 " & _
"ON zmax2.musym = rooting2.musym"
'Turn off warning message.
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
'Re-enable warning message
DoCmd.SetWarnings True
RichardA