Passing variables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can some explain how I can do this or point me in the right direction please

I have a frmMain with buttons to allow maintenance of various data tables. The tables all have the same format so I would like to reuse the code for displaying, etc. To do this I have a frmSystemTblEdit

How do I pass a variable from frmMain to frmSystemTblEdit indicating which table to use? I've tried various definitions of parameters in frmMain but they aren't recognized in the other form (class)

TIA
 
Hello Nestor:
Nestor said:
Can some explain how I can do this or point me in the right direction please.

I have a frmMain with buttons to allow maintenance of various data tables.
The tables all have the same format so I would like to reuse the code for
displaying, etc. To do this I have a frmSystemTblEdit.
How do I pass a variable from frmMain to frmSystemTblEdit indicating which
table to use? I've tried various definitions of parameters in frmMain but
they aren't recognized in the other form (class).
You could create properties on frmSystemTblEdit which map to the variables
you want to pass in. Create an overloaded constructor and pass them in when
you instantiate the form.

Another method is to store that data in a module (VB.NET) or a sealed class
with all Static Properties(C#) and you can reference them from anywhere.

HTH,

Bill
 
Back
Top