Private Sub Form_Load()
Me.List0.RowSource = "SELECT Bangchinh.Maluutru, Bangchinh.Hoten, Bangphu.Yeucau, Bangchinh.Ketluan, Bangchinh.Tuoi, Bangchinh.Ngaysieuam, " & _
"Bangchinh.Diachi FROM Bangphu INNER JOIN Bangchinh ON Bangphu.Mayeucausieuam = Bangchinh.Mayeucausieuam WHERE Maluutru = 0"
End Sub
Private Sub Text2_Change()
Dim strSql As String
strSql = "SELECT Bangchinh.Maluutru, Bangchinh.Hoten, Bangphu.Yeucau, Bangchinh.Ketluan, Bangchinh.Tuoi, Bangchinh.Ngaysieuam, " & _
"Bangchinh.Diachi FROM Bangphu INNER JOIN Bangchinh ON Bangphu.Mayeucausieuam = Bangchinh.Mayeucausieuam " & _
"WHERE [Maluutru] & [Hoten] & [Ngaysieuam] & [Diachi] & [Tuoi] & [Yeucau] Like ""*" & Me.Text2.Text & "*"""
Me.List0.RowSource = strSql
End Sub
The search which I found has a text box with the content like "... results were found." That search uses a list box, I see this code:it uses Conditional Format (Ribbon->Format->Conditional Formatting).
on the search form i modified, open in Design View, select all the textboxes on the Detail
section of the form.
Go to ribbon and see the Conditional Formatting.
Which part of the code is "search as you type", can I have it inserted in the search box which @arnelgp modified for me? Or it's just a feature for listbox only?According to your notes in the DB you were just searching for a client so thats all I included in the SQL. The rowsource is established in code, not in the listbox.
note the following events
Thats just to load a blank record in listbox because I set column heads to yes.Code:Private Sub Form_Load() Me.List0.RowSource = "SELECT Bangchinh.Maluutru, Bangchinh.Hoten, Bangphu.Yeucau, Bangchinh.Ketluan, Bangchinh.Tuoi, Bangchinh.Ngaysieuam, " & _ "Bangchinh.Diachi FROM Bangphu INNER JOIN Bangchinh ON Bangphu.Mayeucausieuam = Bangchinh.Mayeucausieuam WHERE Maluutru = 0" End Sub
This is where the rowsource is set for the listboxCode:Private Sub Text2_Change() Dim strSql As String strSql = "SELECT Bangchinh.Maluutru, Bangchinh.Hoten, Bangphu.Yeucau, Bangchinh.Ketluan, Bangchinh.Tuoi, Bangchinh.Ngaysieuam, " & _ "Bangchinh.Diachi FROM Bangphu INNER JOIN Bangchinh ON Bangphu.Mayeucausieuam = Bangchinh.Mayeucausieuam " & _ "WHERE [Maluutru] & [Hoten] & [Ngaysieuam] & [Diachi] & [Tuoi] & [Yeucau] Like ""*" & Me.Text2.Text & "*""" Me.List0.RowSource = strSql End Sub
heres copy with changes