Mike,

I _think_ that the problem is to do with your look-up variable:

You need to create a variable, say, vShortCut in your expression builder with a value "shortcut" and use the dotted variable in your look-up:

NameDose = NameDose IN scripts +
 WHERE NameDose CONTAINS .vShortCut +
 OR shortcut = .vShortCut

Regards,
Alastair.


----- Original Message ----- From: "Michael J. Sinclair, MD" <[email protected]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Saturday, May 23, 2009 3:00 AM
Subject: [RBASE-L] - RBASE 7.6, Lookup in a form returns the first line in the table


Hi All,
I am converting a form from Rbase 6.5 to Rbase 7.6, and it is not behaving the way it used to work. To simplify my problem, I tried recreating the form with just the bare minimum to do a look up, 2 columns and 1 variable. Here is what I have....

The form is called Medlist1
The table is called medlist1
The look up table is called scripts
On the form I have eliminated everything but 2 fields, shortcut (Text 8) and NameDose (Text 30)
I have one variable in the expression builder....
NameDose = NameDose IN scripts WHERE NameDose CONTAINS shortcut OR shortcut = shortcut

In my look up table I have a few hundred lines of data. My intention is to allow the user to type some or all of the shortcut name for the drug and have all the of the rest of the fields get populated from the corresponding line in the table called scripts. In Version 6.5, if my user typed AMO or AMOX, the field name dose would get the value "Amoxicillin 500 mg". If the user was adding a new drug (not found in the table called scripts), he could just skip the field called shortcut, and tab to the field called NameDose and type whatever new drug he wanted.

In the scripts table my first 2 rows of data look like this....
SHORTCUT                          NAMEDOSE
------------------------------------------------
pcn                              Penicillin 250 mg
amoxil                           Amoxicillin 500 mg

When I run the form, using either EDIT USING or ENTER USING, the form works fine so long as there is some data in the field called shortcut.

B U T......when I first start the form, there is no data in the field called shortcut. Instead of having no data at all (which is what I would like to happen), the form puts the value "Penicillin 250 mg" in the field called NameDose. The SET EQNULL on/off does not seem to matter.

What am I doing wrong??
Sorry to be so long winded....I tried to keep it short.
Mike




--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.339 / Virus Database: 270.12.36/2127 - Release Date: 05/21/09 17:51:00

--- 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