|
-
Feb 1st, 2000, 04:32 AM
#1
I have a textbox (txtaddname) in one form (Form1), and a command button as well. When the button is clicked it pulls up another Form. This is where I place the username and password. If both are correct, I want it to make the textbox in Form1 visible, because by default it is hidden. How do I get it to unhide the textbox?
-
Feb 1st, 2000, 04:51 AM
#2
Store the Result of the Password Check in the Password Forms Tag Property, then check that From your Calling Form, ie.
Code:
Private Sub Command1_Click()
frmLoginForm.Show vbModal
Text1.Visible = Len(frmLoginForm.Tag)
Unload frmLoginForm
End Sub
In frmLoginForm...
Code:
Private Sub cmdCheckPassword_Click()
If txtPassword = "Password" Then
Tag = "OK"
End If
Unload Me
End Sub
Private Sub Form_QueryUnload(Cancel As Integer)
If Visible Then
Hide
Cancel = True
End If
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Feb 1st, 2000, 05:50 AM
#3
I edited the code a bit...
I took off the Form_Query unload section, it didn't like that procedure.
It verifies the password, but only to go back to Form1. The textbox that I want to appear doesn't.
-
Feb 1st, 2000, 05:55 AM
#4
The Code in the QuearyUnload Event is crucial to the Code working, it hides the Form on the First Unload Call to return to the Calling Form, where it has the chance to extract the value from the Tag, try the Code I posted as is to see what I mean.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Feb 1st, 2000, 06:01 AM
#5
I tried it, and still no dice, which form should the Query be unloading, form1 (my main program) or form2 (where I enter the password?)
Also do I need to input anything in the Passwordtxt Tag property, or when I enter the correct password does it do it automatically?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|