I have a public variable with the values being set on my loggin screen with the following code
SELECT user_setup
LOCAL myglobalclass
username = ALLTRIM(Thisform.User_name.Value)
userdepartment = ALLTRIM(Thisform.department.Value)
LOCATE FOR UPPER(user_setup.user_name) = UPPER(ALLTRIM(Thisform.User_name.Value))
IF FOUND() AND ALLTRIM(user_setup.password) = ALLTRIM(Thisform.password.Value)
Thisform.Release()
DO FORM current_user
ELSE
MESSAGEBOX("The User Name or Password is incorrect.","Please try again."
Thisform.password.Value = ""
Thisform.user_name.SETFOCUS
ENDIF
In my main prg I declare the values
oGlobal = CREATEOBJECT('myGlobalClass')
Public myGlobalClass
DEFINE CLASS myGlobalClass AS CUSTOM
username =""
userdepartment =""
ENDDEFINE
When the current_user form loads if I click the button on the form for change password i have to first click in the current_user field to retrieve the value. For some reason it shows it but i have to click the field first.
When the current_user form load if I click the menu bar it gives me the error userdepartment not found then if i click the userdepartment field on the current user form first it shows only the values in the menu for the department.
So my values work, I just need to click the fields first. The two fields on the current user form have thier values being set by the varialbes. Why will it set them here and then make me click the fields before it will allow others to use them
SELECT user_setup
LOCAL myglobalclass
username = ALLTRIM(Thisform.User_name.Value)
userdepartment = ALLTRIM(Thisform.department.Value)
LOCATE FOR UPPER(user_setup.user_name) = UPPER(ALLTRIM(Thisform.User_name.Value))
IF FOUND() AND ALLTRIM(user_setup.password) = ALLTRIM(Thisform.password.Value)
Thisform.Release()
DO FORM current_user
ELSE
MESSAGEBOX("The User Name or Password is incorrect.","Please try again."
Thisform.password.Value = ""
Thisform.user_name.SETFOCUS
ENDIF
In my main prg I declare the values
oGlobal = CREATEOBJECT('myGlobalClass')
Public myGlobalClass
DEFINE CLASS myGlobalClass AS CUSTOM
username =""
userdepartment =""
ENDDEFINE
When the current_user form loads if I click the button on the form for change password i have to first click in the current_user field to retrieve the value. For some reason it shows it but i have to click the field first.
When the current_user form load if I click the menu bar it gives me the error userdepartment not found then if i click the userdepartment field on the current user form first it shows only the values in the menu for the department.
So my values work, I just need to click the fields first. The two fields on the current user form have thier values being set by the varialbes. Why will it set them here and then make me click the fields before it will allow others to use them