| | |
Help transferring data between forms
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 2
Reputation:
Solved Threads: 0
Hi,
I'm currently working on a group project that involves an address book (working in VisualBasic.Net 2003). I have one form (frmData) in which the user enters data. I want to transfer it to a label on my other form (frmAddress). Currently, on frmAddress:
On frmData:
If someone has a suggestion (I obviously have no idea what I'm doing and need lots of help), please reply. I'm very new at this.
I'm currently working on a group project that involves an address book (working in VisualBasic.Net 2003). I have one form (frmData) in which the user enters data. I want to transfer it to a label on my other form (frmAddress). Currently, on frmAddress:
VB.NET Syntax (Toggle Plain Text)
Public strName As String Public DataForm As New frmData Private Sub lblContact_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblContact.SelectedIndexChanged Me.lblContact.Text = strName End Sub
On frmData:
VB.NET Syntax (Toggle Plain Text)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click Dim AddressForm As New frmAddress AddressForm.strName= Me.txtName.Text End Sub
If someone has a suggestion (I obviously have no idea what I'm doing and need lots of help), please reply. I'm very new at this.
Last edited by kajames; Dec 11th, 2008 at 1:35 pm.
what errors came up?
try to use Shared variable to accomodate your address data.
try to use Shared variable to accomodate your address data.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
So, Please do something before post your thread.
* PM Asking will be ignored *
•
•
Join Date: Dec 2008
Posts: 10
Reputation:
Solved Threads: 0
Try changing the code in frmAddress to:
and code for frmDate to:
VB.NET Syntax (Toggle Plain Text)
Public Shared strName As String Dim DataForm As New frmData Private Sub lblContact_SelectedIndexChanged _ (ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles lblContact.SelectedIndexChanged Me.lblContact.Text = strName End Sub
VB.NET Syntax (Toggle Plain Text)
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles btnAdd.Click AddressForm.strName = Me.txtName.Text End Sub
![]() |
Similar Threads
- Some Websites not Loading (Viruses, Spyware and other Nasties)
- Calling outside VB (VB.NET)
- Transferring variables across forms in VB6 (Visual Basic 4 / 5 / 6)
- Need help getting value of text boxes into variables (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: Web Browser and Media Problem
- Next Thread: Open File Dialog
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add application arithmetic array assignment basic binary box button buttons center click code combo combobox component connectionstring convert cpu data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net editvb.net employees excel exists firewall folder image images isnumericfuntioncall login math memory mobile module ms msaccess mssqlbackend mysql navigate net opacity pan peertopeervideostreaming picturebox picturebox1 port print printpreview problemwithinstallation project record regex reports" reuse right-to-left save savedialog search serial sorting sqldatbase storedprocedure string temp textbox timer txttoxmlconverter updown useraccounts usercontol usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio web wpf xml






