A button is clicked and the following query is run
CODE
SELECT Mlist.[Date List Produced], Mlist.[COMPANY NAME], Mlist.ADDRESS,
Mlist.CITY, Mlist.STATE, Mlist.[XZIP CODE], Mlist.COUNTY,
Mlist.[LAST NAME], Mlist.[FIRST NAME], Mlist.[CONTACT TITLE], Mlist.[CONTACT GENDER],
Mlist.[CONTACT PROF TITLE], Mlist.BuySell, Mlist.YearOfGrad, Mlist.[LOCATION ADDRESS],
Mlist.[LOCATION ADDRESS CITY], Mlist.[LOCATION ADDRESS STATE], Mlist.ZIP,
Zip_codes.Latitude AS Latitude, Zip_codes.Longitude AS Longitude
FROM Mlist INNER JOIN Zip_codes ON Mlist.ZIP = Zip_codes.Zipcode
WHERE (((GeoDistance(CSng([Longitude]),CSng([Latitude]),
CSng((SELECT Longitude FROM Zip_codes WHERE Zipcode= Forms![Locate]![ZipTxt] )),
CSng((SELECT Latitude FROM Zip_codes WHERE Zipcode= Forms![Locate]![ZipTxt] )),"mi"))
<=CInt([Forms]![Locate]![DistanceTxt])));
Mlist.CITY, Mlist.STATE, Mlist.[XZIP CODE], Mlist.COUNTY,
Mlist.[LAST NAME], Mlist.[FIRST NAME], Mlist.[CONTACT TITLE], Mlist.[CONTACT GENDER],
Mlist.[CONTACT PROF TITLE], Mlist.BuySell, Mlist.YearOfGrad, Mlist.[LOCATION ADDRESS],
Mlist.[LOCATION ADDRESS CITY], Mlist.[LOCATION ADDRESS STATE], Mlist.ZIP,
Zip_codes.Latitude AS Latitude, Zip_codes.Longitude AS Longitude
FROM Mlist INNER JOIN Zip_codes ON Mlist.ZIP = Zip_codes.Zipcode
WHERE (((GeoDistance(CSng([Longitude]),CSng([Latitude]),
CSng((SELECT Longitude FROM Zip_codes WHERE Zipcode= Forms![Locate]![ZipTxt] )),
CSng((SELECT Latitude FROM Zip_codes WHERE Zipcode= Forms![Locate]![ZipTxt] )),"mi"))
<=CInt([Forms]![Locate]![DistanceTxt])));
Basically it is pulling a list of addresses within so many miles of a certain zip... I know the query is working because i had to debug the distance function to allow for 0 distance (comparing the same zipcodes). It went through many many calculations before failing due to comparing same zipcodes... which i then fixed.
Now i get "Property not found" (it does not specify any property...
If i immediately click the play button in VBA... i get this (shortened):
Home > Troubleshooting > This Expression is Typed Incorrectly, or it is too Complex to be Evaluated
This Expression is Typed Incorrectly, or it is too Complex to be Evaluated (error 3071)
Any ideas?
Your help is appreciated.
Thnx
Edited to prevent page width expansion.
Edited by: VanThienDinh on Sun Dec 28 20:53:51 EST 2008.