I have problem .
Ihave 2 forms , iwant to enter variables on form1 and show them in form2
This what i have soo far
form1
=====
Private Sub Button1_Click(val blala)
Fnamesender = TextBox2.Text
Me.Hide()
Form2.Show()
End Sub
form2
=====
Private Sub Form2_Load(ByVal blabla bla)
Label.text = Fnamesender
end sub
i have a mudule
===========
Module one
Public Fnamesender As String
end module
The Problem is when i enter a text in TextBox2 in form1 and view it in Label its ok , but if you go back to form1 and enter a name in textBox2 it doesnt change in label . how can i clear label
10 2782
I have problem .
Ihave 2 forms , iwant to enter variables on form1 and show them in form2
This what i have soo far
form1
=====
Private Sub Button1_Click(val blala)
Fnamesender = TextBox2.Text
Me.Hide()
Form2.Show()
End Sub
form2
=====
Private Sub Form2_Load(ByVal blabla bla)
Label.text = Fnamesender
end sub
i have a mudule
===========
Module one
Public Fnamesender As String
end module
The Problem is when i enter a text in TextBox2 in form1 and view it in Label its ok , but if you go back to form1 and enter a name in textBox2 it doesnt change in label . how can i clear label
you never explain what is your problem and you can also use like this
Form1
==========
[CODE = vb]
Private Sub Button1_Click(val blala)
Form2.Label.text = TextBox2.Text
Me.Hide()
Form2.Show()
End Sub[/code]
Form1
==========
[CODE = vb]
Private Sub Button1_Click(val blala)
Form2.Label.text = TextBox2.Text
Me.Hide()
Form2.Show()
End Sub[/code]
I still have the same problem even after using your code
Here is my problem
I have two forms form1 and form2
I want to pass variable TextBox2.Text to Label.text in form2 after doing this
i want to go back to form1 and ready to do the proccess again
Problem
Say i entered MIKE in TextBox2.Text in Form2.Label.text i get MIKE , thats good. but if i go back to form1 and enter JOHN in TextBox2.Text
i still get MIKE in Form2.Label.text , Is there a way to clear Form2.Label.text
before reciving the next variable i have tried all , Form2.Label.text="", and clear()
i still cant get it to work . Thanks for your time
Form1
==========
[CODE = vb]
Private Sub Button1_Click(val blala)
Form2.Label.text = TextBox2.Text
Me.Hide()
Form2.Show()
End Sub[/code]
I still have the same problem even after using your code
Here is my problem
I have two forms form1 and form2
I want to pass variable TextBox2.Text to Label.text in form2 after doing this
i want to go back to form1 and ready to do the proccess again
Problem
Say i entered MIKE in TextBox2.Text in Form2.Label.text i get MIKE , thats good. but if i go back to form1 and enter JOHN in TextBox2.Text
i still get MIKE in Form2.Label.text , Is there a way to clear Form2.Label.text
before reciving the next variable i have tried all , Form2.Label.text="", and clear()
i still cant get it to work . Thanks for your time
did you click the command button?
did you click the command button?
Just throw what is the error that you are getting?
The textbox won't get updated by magic. If you put a value in it in the Form_Load event procedure, then this will only happen once when the form is loaded. If you want the value to change later, you have to change it.
It's worth noting that hiding a form does not unload it. So unless you explicitly unload Form2 somewhere along the line, using Show on it will not run Form_Load again. It just makes it visible.
I have problem .
Ihave 2 forms , iwant to enter variables on form1 and show them in form2
This what i have soo far
form1
=====
Private Sub Button1_Click(val blala)
Fnamesender = TextBox2.Text
Me.Hide()
Form2.Show()
End Sub
form2
=====
Private Sub Form2_Load(ByVal blabla bla)
Label.text = Fnamesender
end sub
i have a mudule
===========
Module one
Public Fnamesender As String
end module
The Problem is when i enter a text in TextBox2 in form1 and view it in Label its ok , but if you go back to form1 and enter a name in textBox2 it doesnt change in label . how can i clear label
-
Private Sub Command1_Click()
-
Dim frm2 As Form2
-
FNameSender = Text2.Text
-
Me.Hide
-
Load frm2
-
frm2.Show
-
End Sub
-
or -
Private Sub Command1_Click()
-
Dim frm2 As Form2
-
FNameSender = Text2.Text
-
Set frm2 = New Form2
-
Me.Hide
-
frm2.Show
-
End Sub
-
I don't know about ASP, but in VB6, the Load Form2 will have no effect if Form2 is already loaded.
I don't know about ASP, but in VB6, the Load Form2 will have no effect if Form2 is already loaded.
My code was Quoted by ASP tag, That dont mean my code was written by ASP (i like the color of ASP-tag only).
If you take a look again, you can see that i didnt call "Load Form2". My code was "Load frm2". Here, "frm2" is an entitiy of class Form2. (i must say sorry about the first declare. It must be: Dim frm2 As New Form2)
My code was Quoted by ASP tag, That dont mean my code was written by ASP (i like the color of ASP-tag only).
It certainly makes the keywords stand out.
If you take a look again, you can see that i didnt call "Load Form2". My code was "Load frm2". Here, "frm2" is an entitiy of class Form2. (i must say sorry about the first declare. It must be: Dim frm2 As New Form2)
Good point.
However, this seems like a lot of unnecessary complexity just to show a value on the form when something is clicked. Surely the code should just set the appropriate control on Form2.
It certainly makes the keywords stand out.
Good point.
However, this seems like a lot of unnecessary complexity just to show a value on the form when something is clicked. Surely the code should just set the appropriate control on Form2.
I dont think it bring up complexity in my code. If you approach programing from Object Oriented, you will see thats the common thing. (if you've ever seen some code was written by elder version of VB (4.0 or lest than) , you can see much code like me. Because, in elder version of Vb, programer cannot call Form2.Show directly. Form2 is a class. Cannot calll <ClassName>.<MethodName>.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: rickcheney |
last post by:
I just changed my Access 2002 database to a SQL Server ADP project. I
had a form where the user entered a value into a text box and when a
command button on the form was clicked a Report was...
|
by: Max |
last post by:
I'm new with Javascript and can't seem to figure out what I'm doing wrong
here as I'm not able to pass a simple variable to a function.
In the head of doc I have:
<script...
|
by: Matthew Clement |
last post by:
I'm currently building a form (called frmReports) to set the criteria
for a query, but I'm having some trouble with syntax and hope that one
of the guru's here can help me achieve what I'm do.
...
|
by: SV |
last post by:
Dear all,
In my application I have a lot of hidden fields. I want to make them invisible
for the users though for debugging reasons I want to make them visible. So I
want to add these objects to...
|
by: sofakingfree |
last post by:
I keep getting an invalid property assignment error when tring to
reference a subform.
All I am trying to do is substitute this:
Forms!!.SetFocus
for this:
FormAndSubForm.SetFocus
|
by: Johnny |
last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form
(fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip
code. The user can enter a zip code in the text box and...
|
by: Johnny |
last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form
(fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip
code. The user can enter a zip code in the text box and...
|
by: Scott Zabolotzky |
last post by:
I'm trying to pass a custom object back and forth between forms.
This custom object is pulled into the app using an external reference
to an assembly DLL that was given to me by a co-worker. A...
|
by: Deano |
last post by:
Apparently you can only do this with one value i.e Call
MyAssetLocationZoom(Me!txtLocation, "Amend data")
This runs;
Public Sub MyAssetLocationZoom(ctl As Control, formName As String)
On...
|
by: rfr |
last post by:
I have a need to use a single version of a Visitor Response Feedback Form on
numerous
HTML documents. Rather than have numerous versions of this, one on each HTML
document, it makes more sense to...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |