'''
''' Override the CreateWhereClause(). If the search text box is empty
''' set RunQuery = False. RunQuery = False will not execute the query for the table.
''' This will return zero records and table control will be empty.
'''
Public Overrides Function CreateWhereClause() As WhereClause
Dim wc As WhereClause = MyBase.CreateWhereClause()
If (IsNothing(wc)) Then
wc = New WhereClause
End If
' If no value is entered in the search area hide the table control
If Not IsValueSelected(Me.${Table}Search) AndAlso _
Not Me.InSession(Me.${Table}Search) Then
' Set RunQuery = False
wc.RunQuery = False
End If
Return wc
End Function
|