Where is this code? Is it on the main form? If so, it would be:
Code:
Private Sub Unit_Price_GotFocus()
If Me.[Line] = "[Oakhill Cath]" Then
Me![Unit Price] = DLookup("[Price]", "[Oakhill Cath]", "[Product ID]='" & Me.sbfOrderDetails.Form![Product ID] & "'")
Else
Me![Unit Price] = 500
End If
End Sub
But that really depends on if the name of the subform CONTROL (control on the parent form which HOUSES the subform) is named sbfOrderDetails. You use the subform control name and not the subform name unless they are named the same. So, let's say the control is really named sbfOrderDetails subform, then you would use
Code:
Me![Unit Price] = DLookup("[Price]", "[Oakhill Cath]", "[Product ID]='" & Me.[sbfOrderDetails subform].Form![Product ID] & "'")