Good Day!
i dont know if what is the problem on my code, im trying to disable some of my menu bar when the user account change. For example, if the user which is currently logged is admin, all menu and menu bar will be enable, then if a another user account logged in like guest there will be certain menu he/she can access.
here is my code in my login module:
SELECT user
SET ORDER TO id
LOCATE FOR user.username = ALLTRIM(thisform.txtUsername.Value) AND user.password = thisform.text2.Value
IF found()
SET SKIP OF MENU _msysmenu .f.
thisform.text3.Value = user.role
IF user.admin = "S" *** for guest account
SET SKIP OF BAR 1 OF file .f.
SET SKIP OF BAR 2 OF file .t.
SET SKIP OF BAR 2 OF department .t.
_screen.Caption = "BGHsystem v1.0" +" "+"(WELCOME:"+" "+ALLTRIM(user.fullname)+")"
DEFINE BAR 3 OF File PROMPT "L\<og Out" +" "+ ALLTRIM(user.username)+"..."
ELSE
IF user.admin = "T" *** for admin account
SET SKIP OF BAR 1 OF file .f.
SET SKIP OF BAR 2 OF file .f.
SET SKIP OF BAR 2 OF department .f.
_screen.Caption = "BGHsystem v1.0" +" "+"(WELCOME:"+" "+ALLTRIM(user.fullname)+")"
DEFINE BAR 3 OF File PROMPT "L\<og Out" +" "+ ALLTRIM(user.username)+"..."
ENDIF
ENDIF
attached here is the image of my setup menu items..
thank you in advence
i dont know if what is the problem on my code, im trying to disable some of my menu bar when the user account change. For example, if the user which is currently logged is admin, all menu and menu bar will be enable, then if a another user account logged in like guest there will be certain menu he/she can access.
here is my code in my login module:
SELECT user
SET ORDER TO id
LOCATE FOR user.username = ALLTRIM(thisform.txtUsername.Value) AND user.password = thisform.text2.Value
IF found()
SET SKIP OF MENU _msysmenu .f.
thisform.text3.Value = user.role
IF user.admin = "S" *** for guest account
SET SKIP OF BAR 1 OF file .f.
SET SKIP OF BAR 2 OF file .t.
SET SKIP OF BAR 2 OF department .t.
_screen.Caption = "BGHsystem v1.0" +" "+"(WELCOME:"+" "+ALLTRIM(user.fullname)+")"
DEFINE BAR 3 OF File PROMPT "L\<og Out" +" "+ ALLTRIM(user.username)+"..."
ELSE
IF user.admin = "T" *** for admin account
SET SKIP OF BAR 1 OF file .f.
SET SKIP OF BAR 2 OF file .f.
SET SKIP OF BAR 2 OF department .f.
_screen.Caption = "BGHsystem v1.0" +" "+"(WELCOME:"+" "+ALLTRIM(user.fullname)+")"
DEFINE BAR 3 OF File PROMPT "L\<og Out" +" "+ ALLTRIM(user.username)+"..."
ENDIF
ENDIF
attached here is the image of my setup menu items..
thank you in advence