|
-
Jan 25th, 2004, 11:14 AM
#1
Thread Starter
Fanatic Member
Retain the values back..
How do I retain the values in the textboxes for eg. when I click the a Back button to show the previous form? cuz when i do it now the values are all empty..
-
Jan 25th, 2004, 11:29 AM
#2
Frenzied Member
Save it to a public variable then pull it back in when you return.
-
Jan 25th, 2004, 11:30 AM
#3
Or just Hide the form rather than Unloading it.
-
Jan 25th, 2004, 11:36 AM
#4
Thread Starter
Fanatic Member
i have been using me.hide when i show the next form..from the previous form but cant see the vaules when back..
and wat do you mean by Save it to a public variable then pull it back in when you return..can you pls elborate thanks!
-
Jan 25th, 2004, 11:44 AM
#5
Frenzied Member
What are you using to show it again, something like Form1.Show?
-
Jan 25th, 2004, 11:53 AM
#6
Thread Starter
Fanatic Member
-
Jan 25th, 2004, 12:02 PM
#7
When you show the form again it should have the values in the textboxes unless there is something in the form's Activate event that deletes it.
-
Jan 25th, 2004, 12:04 PM
#8
Frenzied Member
You must be doing something in your code that clears the value, i just wrote a quick 2 form routine that has this for form1:
VB Code:
Private Sub Command1_Click()
Me.Hide
Form2.Show
End Sub
and this for form2:
VB Code:
Private Sub Command1_Click()
Me.Hide
Form1.Show
End Sub
And both Text boxes on the forms retain both their values when I press the command buttons.
If you can't find where the text is being replaced, then you can copy the contents before you go to your other form and then read it back in when you come back. In a Module, delcare a public variable like
Pubic strValue as String
Then in your first form, write the contents before you do a me.hide, like strValue = text1.text. Then when you hit the back button on your second form, do a form1.text1.text = strValue after the form1.show command and before the me.hide command for form 2.
-
Jan 25th, 2004, 12:18 PM
#9
Thread Starter
Fanatic Member
i think i got it cuz i have create a NEW form each time i click the next button....tanks to you all!
-
Jan 25th, 2004, 01:57 PM
#10
Frenzied Member
Edit your original Subject and add [Resolved], that will tell people that the subject has been resolved and you no longer require help.
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
|