I have inherited some code that has worked well until an Irish member joined us.
His name "O'Riordan" has caused problems
Part of our basic code looks like this
but the query fails because his name has the single apostrophe.
Can anyone advise how I correct this programmaticall y as there are likely to be others in the corporate staff table.
His name "O'Riordan" has caused problems
Part of our basic code looks like this
Code:
Public Sub Check_name()
fieldmanager = Name
manager = "O'Riordan Patrick"
filterReport = "qry_staff"
Set rstManager = DBEngine(0)(0).OpenRecordset("SELECT distinct name FROM " _
& filterReport & " where name = " & "'" & manager & "'")
records = rstManager.RecordCount
MsgBox ("No of records is " & records)
rstManager.MoveFirst
manager_name = rstManager.Fields("name")
MsgBox ("Name is " & manager_name)
End Sub
Can anyone advise how I correct this programmaticall y as there are likely to be others in the corporate staff table.
Comment