POWERPICK

This function will display a picklist allowing the user to rapidly select a value.  

POWERPICK(tag // SQL // Server // Remote Index// Distinct // DataColumn // Column Widths)

PARAMETERS

tag

The TAG value of one of the controls on your form OR a memory variable.  This is the control that the user-selected value will be stored to

SQL

The sql statement used to populate the PowerPick list.  A hard coded set of values may also be used by entering a comma delimited list of values.  Always ensure that both the SQL and the Hard-coded list are surrounded by double quotes

Server

The Server used to query against .. use --- for the local device

Remote Index

The remote index (Only used for remote tables ... otherwise leave blank).

Distinct

1 = Only show distinct values
0 = Show ALL values
NOTE:  In order for DISTINCT to work properly, you must ensure that your SQL returns data sorted ASCENDING

Data Column (OPTIONAL: Deafults to ZERO))

A ‘zero based’ value which determines the column you wish to retrieve the value of.  For example, if you have chosen to display the following fields:  FIRSTNAME,LASTNAME,ID    you could retrieve the ID of the chosen customer by using 2 as your DataColumn value.

 

Column Widths (OPTIONAL)

The column widths in TWIPS.  ie.  To set the 1st 4 columns enter the following:  1000,2000,1500,4000.

 

 

To display a PowerPick list you could use the following syntax:

POWERPICK(TEXT1//"SELECT myField FROM myTable"//"---"//)

 

To fill the PowerPick with a hardcoded list of Months, you would enter:

POWERPICK(TEXT1 //"Jan,Feb,Mar,Apr,May,Jun,Nov,Dec"//"---"//)

 

To fill the PowerPick with a hardcoded list of Months AND save the results to a memory variable called MONTH, you would enter:

POWERPICK(<!MONTH!>//"Jan,Feb,Mar,Apr,May"//"---"//)

To fill the PowerPick with the contents 3 fields of a Table and save the value of the 3rd column to a memory variable called ID: (Remember, the DataColumn property is ZERO based, so we need to enter 2 in order to retrieve the value in the 3rd column)

POWERPICK(<!ID!>//"SELECT FirstName,LastName,ID FROM tblCustomers"//"---"//False//2)