You have to execute a query:
lngPatientID = currentdb.execute("SELECT ph.PatientID" & _
" FROM PatientPhone ph INNER JOIN Phone ON ph.PhoneID=
Phone.PhoneID" & _
" WHERE Phone.PhoneNumber = '" & Me.Phone & "'").fields(0)
also a good idea to check if record exist first, using EOF property

Signature
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
>I am trying to pass the value of ph.PatientID to variable lngPatientID as
> seen below. When I use lngPatientID in the next statement below, I get a
[quoted text clipped - 13 lines]
> " ORDER BY p.LastName, p.FirstName;"
> CurrentDb.QueryDefs("qryLookup").SQL = strSQL