Represents a limit. The Limit (Object) applies to Results, Data Model and Query Limits.
If you intend to populate a list box with limit values from the database, add the RefreshAvailableValues (Method) before populating the list box. This enables the script to update the Results set when the query is opened. |
This example shows how to modify values of an existing Results limit:
MyLimit = ActiveDocument.Sections["Results"].Limits[1] //Clear all the values which are currently set MyLimit.SelectedValues.RemoveAll() // add new values to the selectedvalues collection MyLimit.SelectedValues.Add(2000) //Change the limit criteria MyLimit.Operator = bqLimitOperatorLessThan
This example shows how to create a new query limit from an existing topic:
//Create an empty Limit object from the "Wine.Cost" Topic Item. MyLimit = ActiveDocument.Sections["Query"].Limits.CreateLimit("Wine.Cost") MyLimit.Operator = bqLimitOperatorGreaterThan MyLimit.SelectedValues.Add(10) MyLimit.Name = "Costly Wine" //Adds the limit to the Limit Line - ActiveDocument.Sections["Query"].Limits.Add(MyLimit)
This example shows how to populate a list box control with the list of available values for an existing results limit. The same logic may be applied to Query and Data Model limits:
LimitCount = ActiveDocument.Sections["Results"].Limits[1].AvailableValues.Count for (i=1;I<=LimitCount;i++) ListBox.Add(ActiveDocument.Sections["Results"].Limits[1].AvailableValues[i])
LoadFromFile(Filename As String) As Boolean, RefreshAvailableValues(), Remove()
Read-only: Property ValueSource As BqLimitValueSource
Read-write: Property CustomSQL As String, Property DataType as BqDataType, Property DisplayName As String, Property FullName As String, Property Ignore As Boolean, Property IncludeNulls As Boolean, Property LimitValueType as BqLimitValueType, Property LogicalOperator as BqLogicalOperator as BqLogical Operator, Property Name as String, Property Negate As Boolean, Property Operator As BqLimitOperator, Property Prompt As String, Property SuspendRecalculation as Boolean, Property VariableLimit As Boolean
AvailableValues As LimitValues, CustomValues As LimitValues, SelectedValues As LimitValues