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
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