This is likely a simple problem, but this novice is clueless.
I have a drop down box, whereby an employee is selected by last name, and all associated projects are listed in the resulting query. All seemed to work well, until an employee with the name D’souza was selected. I checked, and this is the correct spelling of the name. The single quotation mark within the name closes the statement and results in an error.
Can someone suggest a way around this?
Any hints and tips are highly appreciated. Thank you.
Here is the code.
Private Sub Combo7_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] = '" & Me![Combo7] & "'"
Me.Bookmark = rs.Bookmark
End Sub
I have a drop down box, whereby an employee is selected by last name, and all associated projects are listed in the resulting query. All seemed to work well, until an employee with the name D’souza was selected. I checked, and this is the correct spelling of the name. The single quotation mark within the name closes the statement and results in an error.
Can someone suggest a way around this?
Any hints and tips are highly appreciated. Thank you.
Here is the code.
Private Sub Combo7_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Name] = '" & Me![Combo7] & "'"
Me.Bookmark = rs.Bookmark
End Sub