You are correct Larry, I am trying to save coding work by placing the
decision of whether the form is accessed in the EDIT or BROWSE modes inside
the form rather that have to code everywhere the form is called.
The calling code is very simple:

IF v_user_level = 0 THEN
        PAUSE 1 USING 'You do not have permission to access the form - Press any
key to Continue'
ELSE
IF v_user_level >= .req_level THEN
                EDIT USING my_form WHERE my_clause
ELSE
                BROWSE USING my_form WHERE my_clause
ENDIF
ENDIF
I would have to place this code everywhere the form is called. A solution
would be to create a macro:

-- Macro open_form - checks the User access Level and opens the form in the
EDIT or BROWSE modes accordingly
SET VAR vform = .%1
IF v_user_level = 0 THEN
        PAUSE 1 USING 'You do not have permission to access the form - Press any
key to Continue'
ELSE
IF v_user_level >= .req_level THEN
                EDIT USING &vform WHERE my_clause
ELSE
                BROWSE USING &vform WHERE my_clause
ENDIF
ENDIF
RETURN

Now, my calling program simply has:

RUN open_form.prc USING 'my_form'

Instead of the 9 lines of code above an the form would open in either EDIT
or BROWSE mode depending on the User Level
Ideally I would like to have this code in the form (Before Start EEP???):

IF v_user_level = 0 THEN
        CLOSEWINDOW
ELSE
IF v_user_level >= .req_level THEN
                PROPERTY TABLE my_table ACCESS_MODE 'EDIT'
ELSE
                BROWSE TABLE my_table ACCESS_MODE 'BROWSE'
ENDIF
ENDIF
RETURN

Or something like that...oh well, maybe more work that it is worth...
Javier,

Javier Valencia, PE
President
Valencia Technology Group, L.L.C.
14315 S. Twilight Ln, Suite #14
Olathe, Kansas 66062-4578
Office (913)829-0888
Fax (913)649-2904
Cell (913)915-3137
================================================
Attention:
The information contained in this message and or attachments is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material.  Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended recipient
is prohibited. If you received this in error, please contact the sender and
delete the material from all system and destroy all copies.
======================================================

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of Lawrence Lustig
Sent: Thursday, June 02, 2005 1:32 PM
To: RBG7-L Mailing List
Subject: [RBG7-L] - Re: Form Questions...

> Javier, have you tried BROWSE USING when you want it non-editable but
usable?

Javier is trying to make that determination in the ON BEFORE START EEP (so
that
all the code travels with the form).  At that point, the EDIT or BROWSE
command
has already been issued.
--
Larry

Reply via email to