| | |
Help transferring data between forms
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
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 2005 2008 access account add arithmetic array assignment basic box button buttons center check code component connectionstring convert cpu crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist editvb.net excel file-dialog firewall folder ftp generatetags hardcopy image images insert intel isnumericfuntioncall math monitor mssqlbackend mysql navigate net networking opacity output passingparameters peertopeervideostreaming picturebox1 port printpreview problem problemwithinstallation project record reports" reuse savedialog searchvb.net select serial storedprocedure string tcp temp text textbox timer toolbox trim updown user useraccounts usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf






