| | |
Displaying Input from one form onto another
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 15
Reputation:
Solved Threads: 0
I have created form resembling a standard dialog box where some enters there name into a text box and then hits 'ok' taking them to the main form..On this form I need to get the name that is typed into the text box to be displayed on the main form.
How do I go about doing this?
The standard dialog box form is named frmInput and the text box is named txtName
The label where the Name is be displayed on the main form (frmSquare) is named Label1
How do I go about doing this?
The standard dialog box form is named frmInput and the text box is named txtName
The label where the Name is be displayed on the main form (frmSquare) is named Label1
•
•
Join Date: Mar 2009
Posts: 910
Reputation:
Solved Threads: 167
0
#2 Oct 29th, 2009
Several ways in which to do this and here are three...
1.) (Pass) Add a module and declare a public string variable and when user hits ok, you set the variable with the string you want. Then when the other form loads, that form retrieves the value and displays it in your label.
2.) (Push) From the form that recieves the input you can directly set the value of the label.
3.) (Pull) When user clicks OK you hide the input form, show the display form and pull the information from the input form.
Good Luck
1.) (Pass) Add a module and declare a public string variable and when user hits ok, you set the variable with the string you want. Then when the other form loads, that form retrieves the value and displays it in your label.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
'module code Option Explicit Dim MyString As String '------------ 'form that accepts input Option Explicit Private Sub Command1_Click() MyString = Text1.Text Form2.Show Unload Me End Sub '-------------- 'main form that displays input Option Explicit Private Sub Form_Load() Label1.Caption = MyString End Sub
2.) (Push) From the form that recieves the input you can directly set the value of the label.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Option Explcit Private Sub Command1_Click() Load Form2 Form2.Label1.Caption = Text1.Text Form2.Show End Sub
3.) (Pull) When user clicks OK you hide the input form, show the display form and pull the information from the input form.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
'input form Option Explicit Private Sub Command1_Click() Me.Hide Form2.Show Unload Me End Sub '----------------- 'Display Form Option Explicit Private Sub Form_Load() Label1.Caption = Form1.Text1.Text End Sub
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
0
#3 Oct 30th, 2009
I think that code is too long to handle , may be this will help you !!
Try it
Best Of Luck
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Command1_Click() Me.Hide Form2.Show Form2.Label1.Caption = Text1.Text End Sub
Best Of Luck
Who wants to be a GOD ??
![]() |
Similar Threads
- Displaying contact form inputs properly in the email (PHP)
- Disable/Lock Text Input Form Fields (JavaScript / DHTML / AJAX)
- Displaying Graphics on a Form (C#)
- How can we export datas to Excel sheet. Becaause the input is in given form? (C#)
- How do I get a form to capture ALL keyboard input? (C#)
- Input without a form for DLL (Visual Basic 4 / 5 / 6)
- Problem with Input Form (ASP)
- How do I create own Shout box/or input and display form? (PHP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Help Pls on how to disable popup menu on right click such as undo, cut, copy etc.
- Next Thread: TempMsg ( Tempory Message )
Views: 502 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver struct table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





