Diane,

 

The way I have been doing this is as follows:-

 

I have two tables, one the Schedule which is being priced (SCHED) and another 
containing the rates for various items (RATES). These are ‘linked’ by way of a 
description for the item, DESCR, which is common to both tables. I have an 
autonum column (SEQNO) in the SCHED table, thus assigning a unique value to 
each row. A variable, vseqno, is assigned to this column in the form, and 
another variable is assigned to the description, vdescr. 

 

The OnExit DBGrid Column EEP looks a bit like this (I have simplified my actual 
code so this is a bit clearer ):-

 

IF (RBTI_DIRTY_FLAG = 1) AND (RBTI_FORM_COLNAME='descr') THEN

  SET VAR vcost=cost IN rates WHERE descr=.vdescr

  UPDATE sched SET cost=.vcost WHERE seqno=.vseqno

ENDIF

 

I have a RECALC VARIABLES command and a PROPERTY table &RBTI_FORM_TBLNAME 
'POST’ and a REFRESH in my actual code as well ensure that the variables are up 
to date, the data is saved and the form is refreshed.  Others may have a better 
way of doing this, however this approach works for me – the actual EEP has some 
200 lines and also calls other command files depending on the data entered.  (I 
welcome any suggestions as to how to improve this.)

 

I hope this helps – you are welcome to email me off list if you wish.   And 
yes, it is New Zealand – I am glad you enjoyed your time here.  

 

Good luck.

 

Regards,

 

John Docherty

 

 

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, 7 October 2008 7:26 a.m.
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Changing Value of DBGrid Column Using Property

 

Hi, John (and anyone else),

I guess what I am wondering is what syntax is used to reference the value of a 
column cell in a DBGrid through an OnExit DBGrid Column EEP; and if it's 
possible to update/replace/change a value of a column via the OnExit DBGrid 
Column EEP.

Do you have any sample EEP code where you assign the contents of a DBGrid 
column cell to a variable; and where you assign the value of a variable to a 
DBGrid column?  That's really what I am trying to figure out - the example I 
used was just an example.  I am new to this version of R:BASE and am not 
finding the documentation to be particularly helpful in this regard.

Looking at your e-mail address - are you based in NZ?  If so, I was fortunate 
enough to spend a month there in the 1980's visiting many national parks, 
hiking the Routeburn Track and taking lots of pictures.  It is one of the most 
beautiful countries I've ever been to and the people were incredibly friendly.

Diane DeMers
DeKalb, IL 

 

In a message dated 10/3/2008 11:54:44 P.M. Central Daylight Time, [EMAIL 
PROTECTED] writes:

Diane,

As you say you just need to do all of this in the OnExit DBGrid Column EEP.   
Using you example, (which you are not using ?), and relating that to a form I 
have, I have a computed column for the total cost; the user enters the quantity 
and then the unit price can be entered manually, or extracted from another 
table, via various methods.  I use the RBTI_FORM_COLNAME to check the column 
just exited and then do whatever is required based on that.  It all is pretty 
straightforward – if you would like me to send you more details let me know.  
(I find the DBGrid an extremely useful object – it  has had numerous features 
added to it which have made it even better in recent years.)

Regards,

 John Docherty

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Friday, 3 October 2008 8:55 a.m.
To: RBASE-L Mailing List
Subject: [RBASE-L] - Changing Value of DBGrid Column Using Property

Hi, all, 

I have a main table (say, Customers) and a linked subtable (say, Orders) on a 
form.  The subtable is displayed in a DBGrid. 

When the user enters a value in the column Quantity of the DBGrid, I want to be 
able to calculate the TotalPrice column in the DBGrid through code in an OnExit 
DB Grid Column EEP.  For example, when I exit the Quantity column, if the 
Quantity is less than 100, then the price per item is $5.00; if the Quantity is 
>= 100 and < 500, the price per item is $4.50; if the Quantity >= 500, then the 
price per item is $4.00.  I then compute the TotalPrice and want to pop that 
value in the column TotalPrice. 

(This is not what I am really doing; I have a different application where based 
on the contents of one column, I do a lookup into a table using that column and 
want to copy the resulting value into another column of the DB Grid.) 

Any ideas?  I am a newbie to R:BASE Turbo V-8; the last version I worked with 
was 6.5++.  Thank you in advance. 

Thanks,

Diane DeMers


  _____  


Looking for simple solutions to your real-life financial challenges? Check 
<http://pr.atwola.com/promoclk/100000075x1209382257x1200540686/aol?redir=http://www.walletpop.com/?NCID=emlcntuswall00000001>
  out WalletPop for the latest news and information, tips and calculators.





  _____  

New MapQuest Local shows what's happening at your destination. Dining, Movies, 
Events, News & more. Try it out 
<http://local.mapquest.com/?ncid=emlcntnew00000001> !

Reply via email to