Tom,

I think David is right on here, not that what I think means much, 
just ask my wife...  but when I replied to your post yesterday I was 
trying to understand why I hadn't experienced some of the same 
things. David's post turned on the lights.

A while back I got fed up with trying to keep track of all the eeps I 
was generating, and limited myself to one per form. If Exit were 
pressed, nothing else would have the opportunity to execute (see 
below). So, typically, my eeps look something like this (and life got 
a _lot_ easier):


SET v zCmd = 'Set v zCmd = Null'
 -- zCmd executes based on switch or while blocks

SET v   zLastFld TEXT
-- This is the field that the eep was executed from the LAST time it 
was run

SET v zLastKey = (LASTKEY(1))
-- Sometimes I want to know what key was used to enter the field

SET v zFldNm = (CVAL('form_field_name'))
-- Which field was entered

If zFldNm = 'Exit' Then
   goto EndEep
EndIf

Switch (.zFldNm)
  Case 'FldNm1'
     Do stuff
     Set v zCmd = 'UPdate ...'
     Break

  Case 'FldNm2'
     Do Stuff
     Break

  Case 'FldNm3'
     Do Stuff
     Set v zCmd = 'Run ...'
...  
EndSw

Label EndEep

Set v zLastFld  = .zFldNm

Clear var xx, yy, zz, ...

&zCmd
-- As an example, if FldNm3, zCmd just sets itself to null

Return


Ben Petersen


On 12 Sep 2002, at 8:17, David M. Blocker wrote:

> Tom
> 
> Re your form:
> 
> 1.  If running the field entry eep is a problem on saving the row, a
> work around is to do the following:
>    In the calling program, set a variable vWhatNow TEXT = 'RUN'
>   In the EEP on your EXIT button, add in:
>    SET VAR vWhatNow = "EXIT"
>   In the field entry eep, start with:
>     IF vWhatNow = "EXIT" THEN
>        GOTO bottom
>    ENDIF
>    where there is a LABEL BOTTOM at the end of the EEP before the CLE
>    VAR
> and RETURN commands
> 
> 2.   The first issue is to figure out what the error message is
> actually referring to.  From your posting it sounds like you are
> trying to save a row in the region, and in the form there are
> expressions setting the table columns to form variables, is that true?
>     If so, then look at the table into which you are saving:  are
>     there any
> FK's defined?  If yes, check each of them to see which could be
> getting messed up.
> 
> 3.  Have you TRACEd to see exactly where the error is occuring?
> 
> David Blocker
> 
> ----- Original Message -----
> From: "Tom Grimshaw" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, September 11, 2002 4:48 PM
> Subject: HEEEEEEEELP!!!!
> 
> 
> > G'day,
> >
> > Using the latest and greatest RBWin on W2K machine.
> >
> > I have been working over the point of sale module of BizMan
> > I have created a data entry form that can be used with or
> > without a barcode scanner.
> >
> > I am hitting brick walls trying to get R:BASE to do what I want,
> > specifically to display the sum of the item prices in a variable.
> >
> > It is a single table form with a tiered region based on TranDetail.
> > On the first filed of the region there is a field level eep that
> > clears the variables so the current row does not display the data
> > for the previous row.
> >
> > PROBLEM 1.
> > This eep is being run when I am in the last field of the region and
> > click on the exit button.!@#$%
> >
> > The custom action for the exit button is this:
> >
> > SET VAR vScrnMsgChoice TEXT = 'Y'
> > CLOSEWINDOW
> > RETURN
> >
> > Any idea why the field level eep would be run on exit from the
> > row\form? (Same happens for a row level eep.)
> >
> > PROBLEM 2.
> > On the second last field there is some code that gets the cost
> > price, qty, charge and tax rates and extends the detail line.   When
> > I try to save this row using SAVEROW after the calcs are done the
> > error msg R:BASE returns is "No rows exist or satisfy the specified
> > clause." even though the variable vDetailID is set at the form level
> > and the row DOES exist if I abort during TRACE at that point and
> > check the table.
> >
> > Here is the eep:
> >
> > IF vProdServID IS NULL THEN
> >    SET VAR vScreenMsg TEXT = 'No or invalid ProdServID.|+
> > Press [F4] to find product by part of description.'
> >    RUN ScrnMsg2 IN GlobBlok.apx
> >    SKIP -1
> >    RETURN
> > ENDIF
> > IF vBarCode IS NULL AND vProdServID > 0 THEN
> >    RUN PSPrice1 IN PntOSale.apx
> >    SET VAR vSellPrice CURRENCY = .vExtCrGross
> >    SELECT ItemName,ItemBrand,ModelNumb,ProdServDesc INTO +
> >      vItemName IND vi1, +
> >      vBrand IND vi2, +
> >      vModel IND vi3, +
> >      vProdServDesc IND vi4 +
> >      FROM ProductsServices +
> >      WHERE ProdServID = .vProdServID
> > ENDIF
> > UPDATE TranDetail SET +
> >    UnitCr = .vUnitCr, +
> >    UnitDr = .vUnitDr, +
> >    TaxRate = .vTaxRate, +
> >    TaxAmtTD = .vTaxAmt, +
> >    ExtCrNet = .vExtCrNet, +
> >    ExtCrGross = .vExtCrGross +
> >    WHERE DetailID = .vDetailID
> > SELECT SUM(ExtCrGross) INTO +
> >    vSalePrice IND vi1 +
> >    FROM TranDetail +
> >    WHERE HeaderID = .vTranID_I
> > SAVEROW
> > NEXTROW
> > RECALC TABLES
> > RECALC VARIABLES
> > RETURN
> >
> > As you can see I've thrown SAVEROWs and RECALC TABLES and RECALC
> > VARIABLES at it in places they logically should not be needed an
> > attempt to solve
> the
> > problem to no avail.
> >
> >
> > Warmest regards,
> >
> >
> > Tom Grimshaw
> > coy:    Just For You Software
> > tel:    612 9552 3311
> > fax:    612 9566 2164
> > mobile: 0414 675 903
> >
> > post:   PO Box 470  Glebe  NSW  2037  Australia
> > street: 3/66 Wentworth Park Rd  Glebe  NSW  2037
> >
> > email:  [EMAIL PROTECTED]
> > web: www.just4usoftware.com.au
> >
> > "... the control of impulse -- is the first principle of
> > civilization."-- Will Durant, Pulitzer Prize winning philosopher,
> > writer and historian
> >
> > the most needed product in the world can be found at
> > www.thewaytohappiness.org
> >
> > This email and any files transmitted with it are confidential to the
> > intended recipient and may be privileged. If you have received this
> > email inadvertently or you are not the intended recipient, you may
> > not disseminate, distribute, copy or in any way rely on it. Further,
> > you
> should
> > notify the sender immediately and delete the email from your
> > computer. Whilst we have taken precautions to alert us to the
> > presence of computer viruses, we cannot guarantee that this email
> > and any files transmitted
> with
> > it are free from such viruses.
> >
> > ================================================
> > TO SEE MESSAGE POSTING GUIDELINES:
> > Send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: INTRO rbase-l
> > ================================================
> > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
> > In the message body, put just two words: UNSUBSCRIBE rbase-l
> > ================================================ TO SEARCH ARCHIVES:
> > http://www.mail-archive.com/rbase-l%40sonetmail.com/
> >
> 
> 
> ================================================
> TO SEE MESSAGE POSTING GUIDELINES:
> Send a plain text email to [EMAIL PROTECTED]
> In the message body, put just two words: INTRO rbase-l
> ================================================
> TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In
> the message body, put just two words: UNSUBSCRIBE rbase-l
> ================================================ TO SEARCH ARCHIVES:
> http://www.mail-archive.com/rbase-l%40sonetmail.com/
> 


================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to