-
whats wrong wit my code?
this is friends code but i am having problems with it too!
Option Explicit
Public strHidden As String
Private Sub cmdHide_Click()
strHidden = txtHide.Text
txtHide.Text = ""
frmShow.Show
End Sub
*********************
Option Explicit
Private Sub cmdShow_Click()
txtShow.Text = strHidden
End Sub
[Cimperiali: title changed to make it related to question]
-
What exactly are you changing?
-
im trying to make txtHide.Text and txtshow.text the same text
-
It works fine for me.
Create a module, paste this into the module
Code:
Option Explicit
Public strHidden As String
Create a form (form1), add a text box & a command button called by the obvious names, add this code to it.
Code:
Option Explicit
Private Sub cmdHide_Click()
strHidden = txtHide.Text
txtHide.Text = ""
frmShow.Show
End Sub
Create another form (frmShow), add a text box and command button, then add this code.
Code:
Option Explicit
Private Sub cmdShow_Click()
txtShow.Text = strHidden
End Sub
Now, do ctrl-f5, type some text into txtHide, and click the button.
When frmShow is displayed, click the cmdShow button, and the text appears.
-