Hi
Am using a soundex search sequence from http://allenbrowne.com/vba-Soundex.html
I have a button on a form that carries out the following
Code:
Private Sub btn_Search_Click()
DoCmd.Close
DoCmd.OpenForm FormName:="frm_BaptismSurnameSoundexSearchResults"
End Sub
the form is based on the query
qry_BaptismsSurnameSoundexAll
which is
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 (((Soundex([Surname]))=Soundex([Enter a Surname])))
ORDER BY tbl_Baptism.FullDateOfBaptism;
THis works perfectly the first time it is used. However if used a second time the results form just shows no data ie the displayed form is blank. The only way to get it to work again is to shut the database and re open it.
Is the "soundex" being added as a variable? should I add an event on form close to clear such a variable?
thanks
Ian