Question : Apostrophe in combo box search

I have a combo box on a form that goes to the record chosen in the combo box that works fine except when there is an apostrophe.  I have tried to apply other solutions from this an other help pages, but they are not working.  I think I just need to add quotes in my code, but I am not sure where to put them or how many.  I am not good at code and need something simple.  
Thanks so much for this great resource.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
'------------------------------------------------------------
' Combo559_AfterUpdate
'
'------------------------------------------------------------
Private Sub Combo559_AfterUpdate()
On Error GoTo Combo559_AfterUpdate_Err
 
    DoCmd.SearchForRecord , "", acFirst, "[QBName] = " & "'" & Screen.ActiveControl & "'"
 
 
Combo559_AfterUpdate_Exit:
    Exit Sub
 
Combo559_AfterUpdate_Err:
    MsgBox Error$
    Resume Combo559_AfterUpdate_Exit
 
End Sub

Answer : Apostrophe in combo box search

try


    DoCmd.SearchForRecord , "", acFirst, "[QBName] = " & "" & Chr(34) & Screen.ActiveControl & Chr(34) & ""

or

 DoCmd.SearchForRecord , "", acFirst, "[QBName] = " & Chr(34) & Screen.ActiveControl & Chr(34) & ""
Random Solutions  
 
programming4us programming4us