ameliabob Posted April 22, 2011 Share Posted April 22, 2011 I am trying to find away to do a search to find matched records. I have put together the following code Dim sleuths As Recordset, newsleuths As RecordsetDim qry As StringDim dbs As DatabaseDim ctr As Integer, ans As Recordset ctr = 0 Set dbs = CurrentDb qry = "SELECT * FROM NewSleuths JOIN SLEUTHS ON NewSleuths.FirstName=SLEUTHS.FirstName AND NewSleuths.LastName = SLEUTHS.LastName" Set newsleuths = dbs.OpenRecordset(qry, dbOpenDynaset) When I try to execute this I get a message that there is an error in the FROM clause. Can I not have an AND condition in the ON? Link to comment Share on other sites More sharing options...
birbal Posted April 22, 2011 Share Posted April 22, 2011 you need to specify the column names instead of wild card (*) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.