Hide Controls
Hide Table Control Until Searched

Description
This example uses a search box to retrieve fields based upon the information typed into the search box. Unlike a normal table component that displays results when it is first displayed, the results in this example are displayed only after the application user enters a term into a search box and clicks ?Go?.
Variables
Table
Select table that is being displayed
TableControl
Select a table control
Applies to
TableControl class
Code
 
''' 
''' 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
     


  Privacy Statement