James,

 

I do the same thing you do except my approach is much simpler and does the
same thing you want to do..

On each tab I have an Enhance DB Navigator associated with the corresponding
table on the tab, with only the buttons I need enabled; in your case, the
six you have.

If the table has no records, the "delete" button on the navigator will be
automatically disabled and the "insert" button will be enabled. If you have
records in the table, both button will be enabled; same for cancel, save and
refresh.

Real simple, In other words, the navigator does all the work for you without
any extra code, plus you have a consistent look and feel. Give it a try, you
will be surprised.

 

Javier,

 

Javier Valencia, PE

O: 913-829-0888

H: 913-397-9605

C: 913-915-3137

 

From: [email protected] [mailto:[email protected]] On Behalf Of James
Bentley
Sent: Wednesday, April 24, 2013 1:51 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Where to imbed eep commands?

 

Where to imbed eep commands?

I have a form "EdMbrInformation"
that contains multiple tabs as part of a Parent/Child
table structure.

Parent table "MbrRegister" linking key MbrNumber
Subordinate tables:
      MbrCurHomeInfo
      MbrCurWorkInfo
      MbrEmailInfo
      MbrFaceBookInfo
      MbrLinkedInInfo
      MbrComment

on each Panel Page there are six "bit" buttons
     Close
     Cancel
     Refresh
     Save
     Delete
     Add

For any MbrNumber each of the Child Tables may contain
0,1, or many rows.

Depending on whether the form mode is Enter/Edit/Browse
certian buttons need to be ENABLED or disabled
For example
If the Child table contains 0 rows
  Disable the Delete Button
  Enable the Add Button

I have devised the following code.
---
SELECT COUNT(*) INTO FvMbrCmtCount FROM MbrCommentInfo WHERE
MbrNumber=.FvMbrRegMbrNumber
PROPERTY EGBMbrCmt_close ENABLED 'TRUE'
PROPERTY EGBMbrCmt_cancel ENABLED 'TRUE'
PROPERTY EGBMbrCmt_refresh ENABLED 'TRUE'
SWITCH(.RBTI_FORM_MODE)
  CASE 'ENTER'
    PROPERTY EGBMbrCmt_save ENABLED 'TRUE'
    PROPERTY EGBMbrCmt_delete ENABLED 'FALSE'
    PROPERTY EGBMbrCmt_add ENABLED 'FALSE'
    BREAK
  CASE 'EDIT'
    PROPERTY EGBMbrCmt_save ENABLED 'TRUE'
    IF FvMbrCmtCount = 0 THEN
      PROPERTY EGBMbrCmt_delete ENABLED 'FALSE'
      PROPERTY EGBMbrCmt_add ENABLED 'TRUE'
    ELSE
      PROPERTY EGBMbrCmt_delete ENABLED 'TRUE'
      PROPERTY EGBMbrCmt_add ENABLED 'FALSE'
    ENDIF
    BREAK
  CASE 'BROWSE'
    PROPERTY EGBMbrCmt_refresh ENABLED 'FALSE'
    PROPERTY EGBMbrCmt_save ENABLED 'False'
    PROPERTY EGBMbrCmt_delete ENABLED 'False'
    PROPERTY EGBMbrCmt_add ENABLED 'FALSE'
    BREAK
  DEFAULT
    BREAK
ENDSW
RETURN

My question is where should I embed the code?
  * Table: ON ROW ENTRY
  * Panel: ON TAB CHANGE
  * Other location(s)

 

Jim Bentley,
American Celiac Society
1-504-737-3293

  _____  

 

Reply via email to