Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameter to form
Message
From
07/08/1999 11:36:37
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00250894
Message ID:
00251079
Views:
9
Hi Jane

>I want to add a textbox for the user to type in a password. It's just 1 password that works for everyone. SO I want to hardcode the password into the form. How do I get the form to end after the user types in the correct password? If it's incorrect, I have a message and they keep trying until it's correct of they click on cancel. Do I put code to check for the password in the click or the valid of the textbox? When that textbox loses focus, I want the form to unload. I appreciate your help. I'm a novice who may never get past this stage.

Well, I think the best design in this case would be an OK and CANCEL button on your paswword form, where the OK button is only enabled when the current password is the correct one.

Anyway, you will probaly want the pass word to come from a property or a field instead of actually hard coding it:
*Lost Focus of TextBox
Thisform.OKButton.enabled=(alltrim(this.Value)==thisform.cPassword)
Or just:
if alltrim(this.Value)==thisform.cPassword
and then do what you want.

This way they will always have the option to retry or just cancel anyways. If you would rather enable the OKButton before the user exists the TextBox, use InterActive Exchange instead (with a DoDefault())
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform