Search Facility using text box

foxtet

Registered User.
Local time
Tomorrow, 02:03
Joined
May 21, 2011
Messages
129
Dear All
I want implement search facility using txtSearch. and btnReset.
the code is as follows. this doesnt work fine.
Any help is greatly appreciated.

foxtet

Private Sub cmdReset_Click()
Me!txtSearch.SetFocus
Dim strSearch As String
strSearch = "SELECT * FROM tbl_Entity_Info"
Call Form_Load
Call txtSearch_AfterUpdate
End Sub

Private Sub Form_Load()
Me!cmdReset.Enabled = False
Me!txtSearch.Value = "<all>"
End Sub
Private Sub txtSearch_AfterUpdate()
Dim strSearch As String
Dim strText As String

Me!cmdReset.Enabled = (Trim(Me!txtSearch & "") <> "<all>")
If Me!cmdReset.Enabled Then

strText = Me.txtSearch.Value
strSearch = "SELECT * FROM tbl_Entity_Info where ((EntityName like ""*" & strText & "*"")or (IslandName like ""*" & strText & "*"")or (AtollName like ""*" & strText & "*"")or (ContactStatus like ""*" & strText & "*""))"

End If

End Sub
 

Attachments

If you bind the form to a table then you can use the wizard to create a combo box to select the record to find. See the attached db.
 

Attachments

Users who are viewing this thread

Back
Top Bottom