passing control values from form to form

  • Thread starter Thread starter Dave Harris
  • Start date Start date
D

Dave Harris

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
 
* "Dave Harris said:
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"
///
 
Back
Top