I'm finally working on a suggestion I posted to Karen several weeks ago,
namely, making a table read-only for certain users of a form.
But I can't get it to work.
The two forms involved are real simple: The first contains a variable
edit where user enters a customer number and a pushbutton, the heart of
which is:
EDIT USING CustControlPlans +
WHERE CustNo = .vEntry +
ORDER BY ProcNo
The second form, CustControlPlans, is based on the table CustPN and has
a DBGrid of the table CustPN and an Exit button.
I've got the UserID in variable gUserID and a list of "full access"
users in variable gFullAccess, e.g. (Doug, Admin, Felix)
I would think that to prevent an unauthorized user from editing data,
this should work:
IF gUserID NOT IN &gFullAccess THEN
PROPERTY TABLE CustPN 'READONLY TRUE'
ENDIF
That has been traced and the logic is working.
The question is, where does the above code belong?
* Before the EDIT USING command?
* OnBeforeStart EEP in the form CustControlPlans?
* OnAfterStart EEP in form CustControlPlans?
I've tried them all and nothing seems to work.
Should I be using a different property command?
A side question is: For how long is the 'READ ONLY' property valid?
* Till the form closes?
* Till the db is disconnected?
* Till the R:Base session is closed?
TIA
Doug