1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Private Sub Bsearch_Click()
Dim Nomchamp As String
listchamps.SetFocus
listfilter.SetFocus
Nomchamp = listchamps.ItemData(listchamps.ListIndex)
Txt.SetFocus
If listfilter.Value = "Contains" Then
Forms!Projects_Report.RecordSource = "Select * from ProjectsReport where " & Nomchamp & " Like '*" & Txt.Text & "*'"
ElseIf listfilter.Value = "Starts With" Then
Forms!Projects_Report.RecordSource = "Select * from ProjectsReport where " & Nomchamp & " Like '" & Txt.Text & "*'"
ElseIf listfilter.Value = "Exact Match" Then
Forms!Projects_Report.RecordSource = "Select * from ProjectsReport where " & Nomchamp & "=" & """" & Txt.Text & """"
End If
End Sub
Private Sub Form_Open(Cancel As Integer)
listchamps.SetFocus
listchamps.ListIndex = 0
listfilter.SetFocus
listfilter.ListIndex = 0
End Sub
Private Sub listchamps_KeyDown(KeyCode As Integer, Shift As Integer)
KeyCode = 0
End Sub
Private Sub listfilter_KeyDown(KeyCode As Integer, Shift As Integer)
KeyCode = 0
End Sub |
Partager