At 12:18 AM 9/18/2011, TOM HART wrote:

How is the best to do a multi column lookup? What I want to do is
have 4 var edits on a form that each correspond to a column in a
table as follows:

Col1(var1), Col2(var2), Col3(var3), Col4(var4)  in each variable
the user has the option to but in a value or leave it null and
then I want to be able to lookup matches(where the column contains
the value) and pulls up rows from the table.  I know I could do
multiple IFs and THENs but is there an easier way


Tom,

Here's how:

01. Define four Variable Check Box controls that represent the
    name of each column and result in a command variable, such
    as "vSearchCriteria" (TEXT).

    Customize the settings for each Variable Check Box, such as:
    Checked Value: colname
    Unchecked Value: NULL

02. Define a TEXT variable to enter keyword, such as "vKeyword".

    On Exit EEP should define the "vWhereClause" accordingly.

03. Use a Variable Lookup ListView to display data.

    List Source:
    Table Name:
    Key Field:

    Multi-Column
    Choose all relevant columns to be used to display result.

    WHERE Clause:
    WHERE &vWhereClause ORDER BY ...

That's all there is to it!

When all done, the final lookup screen may look like this:

http://www.razzak.com/fun/Multi_Column_Customer_Search.jpg

In this specific example, notice that there are 6 different
options in search criteria.

2011 R:BASE eXtreme 9.1 Super Advanced Training Applications
also include a sample application to demonstrate the use of
such features.

Application: Using Multi-Select Variable Lookup ListViews
Folder: 2011_RBG91_SAT\UsingMultiSelectVariableLookupListViews
Database: MSListVw
DAT File: UsingMultiSelectVariableLookupListViews.dat

Very Best R:egards,

Razzak.
--- RBASE-L
================================================
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
================================================
TO UNSUBSCRIBE: Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
================================================
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body, place any text to search for.
================================================


Reply via email to