locked
Passing Parameters RRS feed

  • Question

  • Hello Guys,

    I am not entirely sure what needs to be done to get this to work. But I have a image below giving you a better picture of what I am trying to achieve.
    As you can see I have a "change password" option at the bottom right of the from on the left. the change password will only work if the user inputs his or her current password, I would like for the current password to be passed on to the change password form where it says current password, how can I do this?

    Friday, April 26, 2013 12:53 AM

Answers

  • According your graphic, you have to forms, and the command box labeled "Change Password" is the one calling the second form....

    In any case, you could have something like this:

    DO FORM <Form2Name> WITH ThisForm.txtPassword.Value   && Will call the second form passing the the value from txtPassword

    In <Form2Name>.Init you have to start with LPARAMETER <pc_var>, which will receive the value from Form1, then all you have to do is

    ThisForm.txtCurrentPassword.Value = <pc_var> (also from <Form2Name>.Init)



    • Edited by Benny Gabel Friday, April 26, 2013 1:44 AM
    • Proposed as answer by Naomi N Friday, April 26, 2013 1:46 AM
    • Marked as answer by mikelvfp Friday, April 26, 2013 2:22 AM
    Friday, April 26, 2013 1:27 AM

All replies

  • According your graphic, you have to forms, and the command box labeled "Change Password" is the one calling the second form....

    In any case, you could have something like this:

    DO FORM <Form2Name> WITH ThisForm.txtPassword.Value   && Will call the second form passing the the value from txtPassword

    In <Form2Name>.Init you have to start with LPARAMETER <pc_var>, which will receive the value from Form1, then all you have to do is

    ThisForm.txtCurrentPassword.Value = <pc_var> (also from <Form2Name>.Init)



    • Edited by Benny Gabel Friday, April 26, 2013 1:44 AM
    • Proposed as answer by Naomi N Friday, April 26, 2013 1:46 AM
    • Marked as answer by mikelvfp Friday, April 26, 2013 2:22 AM
    Friday, April 26, 2013 1:27 AM
  • thanks Benny, lol that was easy..

    Much Appreciated

    Friday, April 26, 2013 2:22 AM
  • Indeed, that's quite easy.

    I'd suggest though, the current password field is there for security reasons and to check whether the user is the real one, not just somebody, who has taken over the user session (while somebody went away not locking the screen for example).

    So the change password form must include a check of the current password anyway (like the normal login) and while it may be quite convenient to not need to retype that password right after login, it should be done. Windows itself will also let you reenter your current password, even if you just logged in seconds before going into the change password dialog.

    What you can allow is starting the "change password" dialog after entry of a valid username, because then the user needs to proof himself with the current password and enter and confirm the new password. No need to first enter the password in the Login form.

    By the way:
    If you have a system with only a few users (let it even be 100) you could prefill the username from the user table, if you save the associated windows account to it. (see ID()), So if Windows User XYZ opens the appliction, GETENV("Username") is XYZ you first look up SELECT username FROM users WHERE WindowsAccount==PADR(GETENV("Username"),LEN(WindowsAccount)) and then write that user name you found into txtUsername.Value. That saves login time and is convenient.

    Bye, Olaf.


    Olaf Doschke (Setmics)

    Friday, April 26, 2013 3:07 PM
  • thank Olaf, I will try this and possibly post if I run into any trouble :)
    Sunday, April 28, 2013 2:52 AM