Help Communicating Between Forms

Joined
Jun 2, 2011
Messages
16
Programming Experience
3-5
I am a a self-taught programmer so there are some huge gaps in my understanding about programming, but I will try to explain my problem as best I can. I have found the help on vbdotnetforums to be exemplary, and I thank any of you for your help in advance.

I am using VS2010.

I am writing a program to take data from a Spreadsheet and add it to a database (In this case, Customer Data). The Spreadsheets are not always the same, but generally have similar columns.

My program compares Column Names to acceptable FieldNames in the Database. Email. CellPhone. Address. And so forth.

If the program finds a Column Name that does not match to an acceptable FieldName, I want to invoke a simple form. The form asks the user to select an acceptable FieldName to map to the Column, or to Ignore (as in, Ignore the data in the Columns completely, and do not add to the database). I called the form class "AddOrIgnore."

So, from AddOrIgnore, I get some string data that my calling program needs to determine how to proceed with the program, but here is where am stuck.

How do I communicate back to the calling program (see what I mean about gaps in my understanding?). I am sure this is basic stuff.

I do not want to include a reference to the calling procedure or the class it is in, because I want to be able to use this form for a bunch of crap.

I tried keeping track of a String address by sending it ByRef to the Constructor of the AddOrIgnore:
VB.NET:
Sub New AddOrIgnore (AcceptableVals() as String, [B]ByRef Val2Track as String[/B])

But I cannot find a way to point to the Val2Track (and thus the original string, for which I have a reference in my calling procedure) in any kind of class-level variable that I can do anything with.

Is there some basic programming concept I am missing here?

Thanks in advance.
 
Duh. Nevermind. I create a Public Variable in the Form Object I am creating it, modify it based on user input, and then read it before I destroy the Form Object, in the calling procedure.

Thanks for anyone that look at this.
 
Back
Top