473,395 Members | 1,762 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,395 software developers and data experts.

passing control values from form to form

I am a raw newbie to VB.NET trying to convert a data processing QuickBasic
program into .NET. I have about 14 forms, the first of which has a bank of
radio buttons identifying the airline. The second bank of radio buttons
identifies the aircraft model, and the third bank of radio buttons lets the
user choose between two processes. I am using public properties to get and
set the values for these three sets of radio buttons. Once these values are
set, the user clicks a 'continue' button which shows the next form which has
textboxes allowing the user to type in two IDs pinpointing the exact
airplane in question. Once these two values are typed in, the user clicks
the 'continue' button which opens one of two more forms depending on which
process the user selected on the first form. I need to be able to import all
of these values into most of the other 14 forms in the solution.
For instance; typing in
If frmAirlineName.Application = "Usair" Then
"some action here"
End If
This gives me this error, "non-shared member requires an object reference".
When I add the keyword 'Share" to the properties, I get this error, "cannot
refer to an instance member of a class within a shared method or shared
method initializer without an explicit instance of the class". This error
shows up on the variable being assigned the 'Value' used in the shared
property.
To put it in simpler terms, I need to pass a control value from one form to
another. Any suggestions would be greatly appreciated.
Also, if you could reccommend a good book on data processing with VB.NET, I
would be thankful.

Dave Harris
Nov 20 '05 #1
1 1901
* "Dave Harris" <dh******@woh.rr.com> scripsit:
I am a raw newbie to VB.NET trying to convert a data processing QuickBasic
program into .NET. I have about 14 forms, the first of which has a bank of
radio buttons identifying the airline. The second bank of radio buttons
identifies the aircraft model, and the third bank of radio buttons lets the
user choose between two processes. I am using public properties to get and
set the values for these three sets of radio buttons. Once these values are
set, the user clicks a 'continue' button which shows the next form which has
textboxes allowing the user to type in two IDs pinpointing the exact
airplane in question. Once these two values are typed in, the user clicks
the 'continue' button which opens one of two more forms depending on which
process the user selected on the first form. I need to be able to import all
of these values into most of the other 14 forms in the solution.
For instance; typing in
If frmAirlineName.Application = "Usair" Then
"some action here"
End If
This gives me this error, "non-shared member requires an object reference".
When I add the keyword 'Share" to the properties, I get this error, "cannot
refer to an instance member of a class within a shared method or shared
method initializer without an explicit instance of the class". This error
shows up on the variable being assigned the 'Value' used in the shared
property.
To put it in simpler terms, I need to pass a control value from one form to
another. Any suggestions would be greatly appreciated.
Also, if you could reccommend a good book on data processing with VB.NET, I
would be thankful.


Quick and Dirty (use properties instead of the variables):

\\\
Public Class Globals
Public Shared AirlineName As String
...
End Class
..
..
..
Globals.AirlineName = "Usair"
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

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

Similar topics

2
by: Curtis Justus | last post by:
Hi, I currently have a control that is on a form and I want to pass that exact instance of the control to another form (a child form that appears on a button click). The control has state,...
3
by: Joe Bloggs | last post by:
Does anyone know if its possible to pass parameters or the values of Request.QueryString from a web page to a custom control class? I'm using a C# Web Application. For Example I have Web Page1...
0
by: adam | last post by:
i have custom user control and i'm trying to pass values to custom user control......I need help it seems to me i cannot pass the value to user control from dropdownlist. I have property in a...
0
by: Neelima Godugu | last post by:
Hi All, I have developed a windows forms user control, which I am going to host in Internet Explorer.. I am familiar with the security settings requirement inorder to do the above. I have...
4
by: gkr | last post by:
Hi I would like to pass values/data from Page1 to Page 2, then capture values on page 2 and return back to Page 1 with the values from page2. Can you pls guide me on how to do this ? I tried...
13
by: Deano | last post by:
Apparently you can only do this with one value i.e Call MyAssetLocationZoom(Me!txtLocation, "Amend data") This runs; Public Sub MyAssetLocationZoom(ctl As Control, formName As String) On...
3
by: Ross McLean | last post by:
Hi all, I've been teaching myself C# for a new project at work. I have a bit of a background in c++ and java but never been what you could call a guru. I'm having some strange things happening...
2
by: Ganesh | last post by:
Hi there, I'm new to .net just started with 2005 and asp.net 2.0, I'm passing control values to other page to retrieve the data from data set based on the passing values. It works fine. But when...
5
by: jmartmem | last post by:
Greetings, I have built an Update Record Form in an ASP page. This form contains a number of fields, such as text boxes and menus, to name a few. Upon clicking the 'submit' button, I want the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.