Thanks for the help, but its still not working. I even simplified it as follows:
=DLookUp("[Distance]","Table_Distances","[APort]=[Forms]![SubForm].[SubFormName]![APort]")
If I delete the "[SubForm]." and open the subform by itself the function works fine. What else could I be doing wrong...