======================================================================
MULTI-COLUMN POP-UPS IN A FORM
======================================================================
PRODUCT: R:BASE VERSION : 4.0
AREA : FORMS CATEGORY: MENUS DOCUMENT# : 654
================================================================
Prior to R:BASE 4.0 you had to use programming (write an entry/exit
procedure) or add extra columns to your database in order to do multi-
column pop-up menus in forms. Now it's easy. You can define them on the
Field settings screen just like you define single column pop-ups.
Choosing the Pop-Up Type
========================
When you say "Yes" to the question "Do you want a pop-up menu for this
field?" on the Field settings screen you get a menu of table names in
the database. Select the table you want to display data from. You then
get another menu asking what kind of pop-up: Single column, Double
column or Expression.
Single Column Pop-Up
====================
Selecting Single column presents a menu of the columns from the selected
table. Choose the column containing the data to be displayed on the
pop-up menu and loaded into the field located on the form. This
procedure hasn't changed from earlier versions of R:BASE.
Double Column Pop-Up
====================
Selecting Double column will again show you a menu of columns in the
selected table. Choose the column to be loaded into the field on the
form. This will be the first column displayed on the pop-up menu. After
you have selected the first column, the menu of columns from the
selected table is displayed again. Choose the other column to appear
on the pop-up menu. The data will be displayed on the pop-up menu in
the order that you select the two columns; the first column selected
will be loaded into the field that is located on the form.
Expression Based Pop-Up
=======================
Selecting Expression allows you to type in an expression referring to
columns in the selected table. You can enter in any expression up to 38
characters long including parentheses. You don't need to begin and end
the expression with parentheses, however. The data loaded into the field
on the form depends on the located length of the field. If the field is
located 8 characters long, then the first 8 characters of data from the
expression result will be loaded into the field. You need to be sure
your expressions are formatted correctly and fields located properly so
that the data will load as desired.
Because the expression length is limited to 38 characters in length, you
may want to use R:BASE shorthand for the column names. Each column name
in a table can also be represented by a number. The first column in a
table is #1, the second #2, etc. The #n designation can be used in place
of the column name when defining expressions for pop-up menus.
For example, instead of
CTXT(empid)&empfname&emplname
you could use
CTXT(#1)
In both cases the actual menu looks like the following:
+------------------------------+
| 102 June Wilson |
| 129 Ernest Hernandez |
| 131 John Smith |
| 133 Peter Coffin |
| 160 Mary Simpson |
| 165 Darnell Williams |
| 166 John Chou |
| 167 Sandi Watson |
+------------------------------+
The other pop-up menu options work just the same. Row and column allow
you to specify the location of the upper left corner of the menu.
Placing a 9 in front of the row number will make the menu automatic
upon entry into the field. The Where clause can be used to qualify the
rows to display from the selected table.
There may still be instances where you will need to write an entry/exit
procedure to do your pop-up menu, for example, your desired expression
is longer than 38 characters or you want to display data from more than
one table. Using this new feature, however, should allow you to simplify
your application by removing many entry/exit procedures from your forms.