strJoin = strJoin & " " & rstPK("COL_PARPHYSNAME_T") _
& " = " & CStr(rstCurr(strField2)) & " "
Else
strJoin = strJoin & " " & rstPK("COL_PARPHYSNAME_T") _
& " = '" & CStr(rstCurr(strField2)) & "' "
End If
End If
rstPK.MoveNext
Loop
rstPK.Close
strJoin = "SELECT * FROM " & strTab & " WHERE " & strJoin
rstPK.Open strJoin, CurrentProject.Connection, _
adOpenKeyset, adLockOptimistic, adCmdText
If Not rstPK.EOF Then
If strTab = strDestTab Then
strColName = LookColumnCol(strCol, "COL_PHYSNAME_T")
GetParentValue = rstPK(strColName)
Else
GetParentValue = GetParentValue(rstPK, strStTab, _
strDestTab, strCol, intLevel—1, strPath)
End If
rstPK.Close
End If
rstRel.Close
Set rstPK = Nothing
Set rstRel = Nothing
Set cmd = Nothing
End Function
Setting a Reference Data Table Value ...