Hi
I see I may have missed out a piece if information.
I have a form with a text box called txtyearofBaptism. A button on the form runs the code in the original post.
If the dcount is 0 then a form is opene advising the user that no results have been found
If the dcount value is not 0 then
frm_BaptismYearSearchResults
is opened based on the query
Code:
SELECT tbl_Parish.Parish, tbl_Church.Church, tbl_Baptism.FicheNo, tbl_Baptism.BirthDate, tbl_Baptism.DateOfBaptism, tbl_Baptism.YearOfBaptism, tbl_Baptism.FullDateOfBaptism, tbl_Baptism.ChildsName, tbl_Baptism.Surname, tbl_Baptism.Sex, tbl_Baptism.Parents, tbl_Baptism.Abode, tbl_Baptism.Occupation, tbl_Baptism.RefNo, tbl_Baptism.PageNo, tbl_Baptism.EntryNo, tbl_Baptism.Minister, tbl_Baptism.Notes, tbl_Baptism.BaptismID
FROM tbl_Parish INNER JOIN (tbl_Church INNER JOIN tbl_Baptism ON tbl_Church.ChurchID = tbl_Baptism.ChurchID_fk) ON tbl_Parish.ParishID = tbl_Church.ParishID_fk
WHERE (((tbl_Baptism.YearOfBaptism) Like [TempVars]![varYear] & "*"))
ORDER BY tbl_Baptism.Surname;
However as I said before a date of 1965 works perfectly whereas 1700 does not
cheers
Ian