Getting the Expected 3 runtime error from the following and I believe it has to do with how I'm using the form data, I've read that form data isn't available to recordset.
Code:
Public Function GetLoc()
Dim GeoData As DAO.Database
Dim Location As DAO.Recordset
Set GeoData = CurrentDb
Set Location = GeoData.OpenRecordset("SELECT TOP 1 CStr(CInt(GeoData!Area))+GeoData!Block+GeoData!Space " & _
"FROM GeoData " & _
"WHERE (((GeoData.EVEN_ODD_I)=IIf(Right([Forms]![Activity]![StreetNo],1)=0,'E',IIf(Right([Forms]![Activity]![StreetNo],1)=2,'E',IIf(Right([Forms]![Activity]![StreetNo],1)=4,'E',IIf(Right([Forms]![Activity]![StreetNo],1)=6,'E',IIf(Right([Forms]![Activity]![StreetNo],1)=8,'E','O')))))) And ((GeoData!STREET_DIRECTION_CD)=[Forms]![Activity]![StreetDir]) And ((GeoData!STREET_NME) Like [Forms]![Activity]![StreetName]+'*') And (([Forms]![Activity]![StreetNo]) Between GeoData!LOW_ADDRESS_NO And GeoData!HIGH_ADDRESS_NO)) ")
Debug.Print Location
End Function
GeoData is a linked table. Form is open and data is inside references, above works in a query, I copied it directly from the query.
I read something about putting the form references outside quotes but I'm not seeing how to do that, tried it a few ways and nothing worked.