473,386 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

need help transfering data between forms

I'm relatively new to VB.NET and have what's probably a very simple
question. I'm trying to get one form to access (view and modify) data on
another form. For example, the startup object is a form called "FormA".
This form contains a string called "ImAString." FormA then opens FormB.
How can FormB read from/write to "ImAString"?

Thanks for your help,
Chris S.
Nov 20 '05 #1
3 3366
Hello Chris

In formB, modify the constructor this way:

Public Sub New(myString as String)

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

me._myString = myString

End Sub

Private _myString as String

Then when calling formB from formA do this:

Dim Myform as New FormB(StringValue)

--
Ibrahim Malluf
http://www.malluf.com
==============================================
MCS Data Services Code Generator
http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
==============================================
Pocket PC Return On Investment Calculator
Free Download http://64.78.34.175/mcsnet/kwickKalk1.aspx


"Chris S" <ce**@earthlink.net> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
I'm relatively new to VB.NET and have what's probably a very simple
question. I'm trying to get one form to access (view and modify) data on
another form. For example, the startup object is a form called "FormA".
This form contains a string called "ImAString." FormA then opens FormB.
How can FormB read from/write to "ImAString"?

Thanks for your help,
Chris S.

Nov 20 '05 #2
J
check out this link.... you will need a vbcity account if you dont have
one..its free LOTS of help on this site

http://www.vbcity.com/forums/faq.asp...Forms#TID29183

"IbrahimMalluf" <Ib*****@malluf.com> wrote in message
news:uZ**************@TK2MSFTNGP10.phx.gbl...
Hello Chris

In formB, modify the constructor this way:

Public Sub New(myString as String)

MyBase.New()

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

me._myString = myString

End Sub

Private _myString as String

Then when calling formB from formA do this:

Dim Myform as New FormB(StringValue)

--
Ibrahim Malluf
http://www.malluf.com
==============================================
MCS Data Services Code Generator
http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
==============================================
Pocket PC Return On Investment Calculator
Free Download http://64.78.34.175/mcsnet/kwickKalk1.aspx


"Chris S" <ce**@earthlink.net> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
I'm relatively new to VB.NET and have what's probably a very simple
question. I'm trying to get one form to access (view and modify) data on another form. For example, the startup object is a form called "FormA".
This form contains a string called "ImAString." FormA then opens FormB.
How can FormB read from/write to "ImAString"?

Thanks for your help,
Chris S.


Nov 20 '05 #3
Cor
Hi Chris,

Better than try to get the information is to suply the information to formB
When it is a dialogform you are making (it sounds a little to that)
\\\formA
dim frm as formB
frm.mystring = mystring
frm.showdialog
///
\\\formA
beneath the form designer code
public mystring as string
(or a real property)
///

I hope this helps
Cor
I'm relatively new to VB.NET and have what's probably a very simple
question. I'm trying to get one form to access (view and modify) data on
another form. For example, the startup object is a form called "FormA".
This form contains a string called "ImAString." FormA then opens FormB.
How can FormB read from/write to "ImAString"?

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

34
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. ...
2
by: Niyazi | last post by:
Hi, I have BIG question and I gues it is the BEST question. I have a problem that I am guessing the best solution is to create some sort ..NET Services. This Service(s) must check every...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
1
by: bshannon | last post by:
I have an intranet site that uses a login. If a user clicks a link that requires them to be logged in it will check. If a user is not logged in the page takes them to the login page. My...
2
by: Piotr Karwatka | last post by:
Hi! I have a little problem an qeustion. In .NET Windows Forms I can do something like that: - i have forms - Form1 Form2, on first form i have TextBox1 control on 2nd form I have Button1...
10
by: Walshi | last post by:
Hi all, I'm a relative newby to access and VBA etc. My forms and tables etc are working great and saving lots of time...However... I have two databases with the exact same table format. I want...
1
by: ankurgupta76 | last post by:
Hi I have a restaurant billing software developed in vb 6 and ms access db as backend. now for old data i have created another copy of db and called it the master db. So periodically i need...
3
by: artillero | last post by:
Im transfering my database to another host and it's pretty large 100mb, can someone please tell me how I can tranfer my large database to phpmyadmin. Thank you
0
by: Ro | last post by:
I've been given the task of transfering data from an access db to sql server 2000. The previous access db was not structured very well so we reconstructed the tables in sql server 2000 to add...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.