Do not let any software impress you!

Only let it convince your intellect.
Slider img 1
Do not look for a business paradise!

It is a waste of time.
Slider img 2
Only yourself can push you uphill.

There is no easy road to prizes.
Slider img 3
Productivity is the name of the game.

And you have to conquer it.
Slider img 4
As long as you understand it,

you will start to build your know-how.
Slider img 5
We can help with that.

We have the tools and the method.
Slider img 6

Create a Multiple-Column Lookup



A lookup list is a field whose we retrieve the value from another table. This article explains creating a lookup list with multiple columns (whereas a choice element is effectively just one column).
A lookup field gets data from a query. The example below shows the steps and the code for a customer lookup list with three columns, customer name, address, and phone.

Step 1: Open the form
Step 2: Go in design view
Step 3: Click “AutoScript”
Step 4: You must write your query in the procedure Form_Start, and you must end your code with the procedure Select_xxx_Params. See the example below.

lib

proc Form_Start()
    ……
    ……
    ……

    start_sql “CUSTOMER“ 1 “KOSMOS“
         SELECT
         CUSTOMERS.CUSTOMER_NAME, CUSTOMERS.ADDRESS,
         CUSTOMERS.PHONE, CUSTOMERS.CUSTOMERS AS CUSTOMERS
         FROM
         CUSTOMERS
         WHERE
         CUSTOMERS.CUSTOMER_NAME LIKE :E
         ORDER BY
         CUSTOMERS.CUSTOMER_NAME
   end_sql


    ……
    ……
    ……
end

proc Select_CUSTOMER 3_Params()
         t = GetEditedText()
         call ParamsEmbSQL(“CUSTOMER 3“t)
end

1. In the “” you must write the query’s name (anything you want)
2. The query’s last field must be the table’s (CUSTOMER) primary key, and the name must be the index of the relationship table (ORDER)
3. Query’s name

Step 5: Save changes
Step 6: Click the field that you want to define as a lookup field, enter the query’s name in “Selection list” and the fields with their width -separated with a ;- in “Selection list format” (in the window “Set” on the right).
For example
Selection List: CUSTOMER
Selection list format: NAME;100;ADDRESS;50;PHONE;15;
Step 7: Exit designing and save changes

For more help, please see http://www.youtube.com/watch?v=i2OCjI1KZr8