stanmurphy
Technical User
- Oct 14, 2000
- 89
Hello All,
I would like to call my main program, SCHEDULE, from a login screen after I have checked for valid username and password.
When I simply call the SCHEDULE form from the LOGIN form, I immediately get an error say that the object SCHEDULE cannot be found.
However, if I run the SCHEDULE form as the main form without calling it from LOGIN, it runs fine. Can anyone help me with this please?
My LOGIN code is below:
*********************************************************
SELECT users
SET ORDER TO username
SEEK ALLTRIM(UPPER(m.USERNAME))
IF FOUND()
IF ALLTRIM(UPPER(users.password)) == ALLTRIM(UPPER(THISFORM.TEXT1.TEXT))
STORE m.USERNAME TO m.CURRENT_USER
THISFORM.HIDE()
DO FORM SCHEDULE
ELSE
MESSAGEBOX("Password Is Incorrect. Please Try Again",0)
STORE "" TO THISFORM.TEXT1.Value
THISFORM.TEXT1.SetFocus
ENDIF
ELSE
MESSAGEBOX("That Is Not A Valid User Name. Please Try Again",0)
STORE "" TO THISFORM.TEXT1
THISFORM.COMBO1.SetFocus.VALUE
ENDIF
I would like to call my main program, SCHEDULE, from a login screen after I have checked for valid username and password.
When I simply call the SCHEDULE form from the LOGIN form, I immediately get an error say that the object SCHEDULE cannot be found.
However, if I run the SCHEDULE form as the main form without calling it from LOGIN, it runs fine. Can anyone help me with this please?
My LOGIN code is below:
*********************************************************
SELECT users
SET ORDER TO username
SEEK ALLTRIM(UPPER(m.USERNAME))
IF FOUND()
IF ALLTRIM(UPPER(users.password)) == ALLTRIM(UPPER(THISFORM.TEXT1.TEXT))
STORE m.USERNAME TO m.CURRENT_USER
THISFORM.HIDE()
DO FORM SCHEDULE
ELSE
MESSAGEBOX("Password Is Incorrect. Please Try Again",0)
STORE "" TO THISFORM.TEXT1.Value
THISFORM.TEXT1.SetFocus
ENDIF
ELSE
MESSAGEBOX("That Is Not A Valid User Name. Please Try Again",0)
STORE "" TO THISFORM.TEXT1
THISFORM.COMBO1.SetFocus.VALUE
ENDIF