On Error GoTo ErrorHandler
Dim sCurUser As String
Dim sDBSys As String
Dim sSql As String
' If the user is in an approved group, then we will enable the buttons
bShowBtns = True
Call GetBufferValue("bpes.UserId", sCurUser)
Call GetBufferValue("bpes.DBNameSystem", sDBSys)
' Exclude certain users from the test
If Trim(sCurUser) <> "SYSADMIN" Then
bShowBtns = False
sSql = "SELECT * FROM UserGrp where UserId like " & SParm(Trim(sCurUser))
Call SqlCursor(CSR_UserGrp, NOLEVEL + SqlSystemDb)
serr1 = SqlFetch1(CSR_UserGrp, sSql, bUserGrp, LenB(bUserGrp))
Do While serr1 = RECORDFOUND
If Trim(bUserGrp.GroupId) = "GN-LEVEL1" Then bShowBtns = True
If Trim(bUserGrp.GroupId) = "GN-LEVEL2" Then bShowBtns = True
If Trim(bUserGrp.GroupId) = "IN-CLERK" Then bShowBtns = True
If Trim(bUserGrp.GroupId) = "PM-IN-10220SB" Then bShowBtns = True
serr1 = SFetch1(CSR_UserGrp, bUserGrp, LenB(bUserGrp))
Loop
Call SqlFree(CSR_UserGrp)
End If