Remember I posted to the list asking for ways people might have used lookups in 
DBGrids.  Well I'm happy to say that I got one to work great.  Just in case 
someone could use this info I'll share it here.
I am using the form with an ENTER USING, where the user will be typing in 
multiple rows at a time.  I am entering the data into a temp table, doing my 
error trapping, and only then do I append to the permanent table.  What this 
means is that my temp table can have as many "extra" columns as I want.  If you 
were doing an entry direct to the permanent table, you could consider adding 
extra columns to the table to hold lookup data.  If you're doing "enter using" 
it's not an issue, but for editing you'd have to consider multi-user issues.
Here's my temp table.  The 4 columns with "tmp" are my lookups:CREATE TEMP 
TABLE tmpVouch (VOUCHER# INTEGER, INVENT# INTEGER, QTYBOT REAL DEFAULT 1, +
  UNITCOST CURRENCY, PCGS# INTEGER, GRADE INTEGER, GRADEBY TEXT 1, +
  STN INTEGER, LOCATION TEXT 3, LABEL TEXT 1, +
  tmpMS_PR TEXT 2, tmpColor TEXT 2, tmpDescrip TEXT 26, tmpExtCostV CURR)

In the form below (shows just part of my form) when they type something in the 
PCGS field, the form needs to look up 3 pieces of information and write it to 
the 3 columns as indicated by the arrows on the print-screen.  I have the 3 
fields designated as read-only, and the "skip read-only columns" is checked on 
the grid.  BTW: I found out that the "skip read-only" in an entry form only 
works if you are tabbing thru the fields, not if you're using [enter]; I 
reported this to RBTI and the next release is going to evaluate for [enter], 
yay!!!
I have a form variable vPCGS# set to the column PCGS#.  Here's the DBGrid EEP, 
"on exit from DB Grid column":

GETPROPERTY DBGrid CURRENTCOLUMNNAME "vCurrentColName"
SWITCH (.vCurrentColName)
CASE "PCGS#"
  SELECT ms_pr, color, descrip INTO vText1 IND iv1, vText2 IND iv1, vText3 IND 
iv1 +
    FROM coininfo WHERE pcgs# = .vpcgs#
  PROPERTY TABLE_COLUMN[tmpVouch->tmpms_pr]   TEXTVALUE .vText1
  PROPERTY TABLE_COLUMN[tmpVouch->tmpColor]   TEXTVALUE .vText2
  PROPERTY TABLE_COLUMN[tmpVouch->tmpDescrip] TEXTVALUE .vText3
  BREAK
ENDSW

In the print-screen, I have typed 7135 in the PCGS# field, press [enter] to go 
to the Graded By field.  It fills in the 3 columns.
Karen

-- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/1589781869.4219694.1574299245786%40mail.yahoo.com.

Reply via email to