473,803 Members | 3,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3385
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.

InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() call

me._myString = myString

End Sub

Private _myString as String

Then when calling formB from formA do this:

Dim Myform as New FormB(StringVal ue)

--
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******** ******@TK2MSFTN GP10.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

"IbrahimMal luf" <Ib*****@malluf .com> wrote in message
news:uZ******** ******@TK2MSFTN GP10.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.

InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() call

me._myString = myString

End Sub

Private _myString as String

Then when calling formB from formA do this:

Dim Myform as New FormB(StringVal ue)

--
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******** ******@TK2MSFTN GP10.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
7116
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. Yensao
2
595
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 hour the data that reside on AS400 and transfer into the SQL Server. Services also have to be run in between 8:00 AM and 5:00 PM
19
4114
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 the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
1
1166
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 Problem: The user will now log in. How can I take the user back to the page that required the login? I want the user to
2
1513
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 control - on second Form i can acces data from Form1 like that: for example: MessageBox.Show(Form1.TextBox1.Text);
10
2200
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 db1 to be used to input data by a remote operator, when she is ready I want her to be able to click a control button to email her new data to db2. This new data will be added to the table in db2 ready for further processing.
1
1783
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 to transfer data from the current db to the master db also considering the situation wherein the current db may already have some of the data which has already been copied into the master. right now i am first creating a csv file from the current...
3
2677
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
1626
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 better table structure and more functionality. What I want to be able to do is transfer the actual data in the access tables to the new tables in the sql server 2000 db. Does anyone know of a simple way to do this? I've been looking into CA...
0
9564
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10316
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.