Mark this is the code i am using to validate wether the person has access to the form or not if he has no access then it will goto the last if case. I am getting the program error when the person has no access if a person has access then i am not getting the program error.
first the no access message comes when i click the ok button of the message box after that i am getting program error messgage.
************************Code from Here mark Thank you Very Much*********
local modCode, sGroup, sMod, GroupCodeLocator, mAccessString
IF TYPE("mDataPath") <> "C"
DO "SetPath"
ENDIF
IF TYPE("gVersion") <> "C"
PUBLIC gVersion
gVersion = "PMIS"
ENDIF
IF TYPE("mAccess")<>"C"
PUBLIC mAccess
mAccess =";"+this.securitygroup+LOWER(this.securitymod)+";"
ENDIF
set step on
IF NOT EMPTY(gUser)
modCode = This.SecurityMod
sGroup =this.securitygroup
sMod =this.securitymod
* BY PASS IF Group and Mod are "X"
IF sGroup = "X"
mViewType ='EDIT'
ELSE
* CHECK IF THERE IS A ; AT THE END OF THE ACCESS
IF LEN(mAccess)<>RAT(";",mAccess)
mAccess = mAccess+";"
ENDIF
mViewType = "NOACCESS"
* check for group access ie change control, submittals,utilities
GroupCodeLocator = AT(";"+sGroup,mAccess)
IF GroupCodeLocator >= 1
* separate out the access for this group
mAccessString = SUBSTR(mAccess,GroupCodeLocator+2)
mAccessString = SUBSTR(mAccessString,1,AT(";",mAccessString) -1)
DO CASE
CASE LOWER(sMod)$mAccessString && EDIT ACCESS
mViewType = "EDIT"
thisform.setaccess
OTHERWISE && NO ACCESS
mViewType = "NOACCESS"
ENDCASE
ENDIF
ENDIF
ELSE
ENDIF
IF mViewType='NOACCESS'
=MESSAGEBOX("You do not have access to this Module.",48)
RETURN .F.
ENDIF
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only