SQL Object
 
Syntax
 
SQL.SearchWithQueryArray(Query[, AltCaption][, ReturnColumn] _
                          [, ExtraItem][, arrSelected])
 
Description
Performs a search using a SELECT query, displaying the result in a standard TRADIUM multiple-choice dialog box and returning the selected items in an array. Here the entire row or a specific column can be specified. Optionally, multiple items can be added at the bottom of the result of the SELECT query.
 
The array must first be declared with a ReDim statement and be of type String. The function returns the number of selected items in the first element (0). See also the example below.
 
Parameter
Description
Query
The complete SELECT query, including named column specifications.
AltCaption
Optional. Replaces the default title text in the dialog box.
ReturnColumn
Optional. If not specified or value -1: the entire row is reported back, using Chr$(9) (tab character) as the field separator.
ExtraItem
Optional. Additional lines to be added at the bottom of the list. Lines are separated by a CR/LF string and fields are separated by the TAB character.
Notice: The number of fields should match the number of fields in the SELECT query.
arrSelected
Optional. An array variable that lists the items to be selected by default. The values must exactly match the values in the ReturnColumn. If ReturnColum is not specified or is value -1, the values in this array variable must match the entire line exactly, with the columns separated by the Chr$(9) sign.
 
See Also
other SQL.Searchxxxxxxxx functions, SearchWithQuery.
Example
Sub Main()
 
    ReDim aResult(0) As String
    Dim sQuery As String, x As Integer
 
    sQuery = "SELECT Admin, Code, Omschrijving FROM Prm_BTW"
 
    aResult = SQL.SearchWithQueryArray(sQuery, "VAT overview:", 1, _
                                       "1" & vbTab & "" & vbTab & "No VAT charge")
 
    For x = 1 To Val(aResult(0))
        Debug.Print aResult(x)
    Next x
 
End Sub