Private Sub txtName_Click()
' If user clicks on the name, check or clear
' the checkbox
On Error Resume Next
Me!ckPrintFlag = Not Me!ckPrintFlag
End Sub
Private Sub Text41_Change()
Dim strTextBox As String
strTextBox = Me.Text41.Text
Me.Filter = "video_name like '*" & ESQ(strTextBox) & "*'"
Me.FilterOn = True
Me.Text41 = strTextBox
Me.Text41.SelStart = Len(strTextBox)
End Sub
'function to escape single quotes
Private Function ESQ(str As String) As String
ESQ = Replace(str, "'", "''")
End Function
Option Compare Database
Private Sub Text41_Change()
Dim strTextBox As String
strTextBox = Me.Text41.Text
Me.Filter = "[Vendor Name] like '*" & ESQ(strTextBox) & "*'"
Me.FilterOn = True
Me.Text41 = strTextBox
Me.Text41.SelStart = Len(strTextBox)
End Sub
'function to escape single quotes
Private Function ESQ(str As String) As String
ESQ = Replace(str, "'", "''")
End Function
Dim strTextBox As String
Dim rst As DAO.Recordset
strTextBox = Me.txtSearch.Text
Set rst = Me.RecordsetClone
rst.FindFirst "[Vendor Name] like '" & ESQ(strTextBox) & "*'"
If rst.NoMatch Then
Me.Detail.Visible = False
Exit Sub
Else
Me.Detail.Visible = True
End If
Me.Filter = "[Vendor Name] like '" & ESQ(strTextBox) & "*'"
Me.FilterOn = True
Me.txtSearch = strTextBox
Me.txtSearch.SelStart = Len(strTextBox)