K
kratz
I have seen some posts on this subject but I still cannot make my app work right.
I have a MDI application with a parent form and two child forms.
The parent form is called Mainform
The child forms are called invoiceForm and customerForm
I have a dataset containing customer info which I would like to make available to all forms.
The dataset is called dsCustomers
So in my parent form code in the general declarations area I have this
I open each form from MainForm like this
I have a MDI application with a parent form and two child forms.
The parent form is called Mainform
The child forms are called invoiceForm and customerForm
I have a dataset containing customer info which I would like to make available to all forms.
The dataset is called dsCustomers
So in my parent form code in the general declarations area I have this
Code:
Public Shared WithEvents DSCust As New InvoiceWhiz.dsCustomers
Public custForm As New customerForm
Public invForm as new invoiceForm
I open each form from MainForm like this
Code:
invForm.MdiParent = Me
custForm.MdiParent = Me
invForm.Show()
custForm.show()
[\code]
I reference the dataset from the children like this
[code]
datagrid.datasource = Mainform.DSCust.customer
[\code]
All of this builds with no errors and runs fine at first then VS gives an error like this
C:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\InvoiceWhiz\customerForm.vb(70): The variable 'DSCust' is either undeclared or was never assigned.
And then erases my reference in the child code.
Cany anyone help me out on this?
Thanks,
Kratz
From http://www.developmentnow.com/g/38_0_0_0_0_0/dotnet-languages-vb.ht
Posted via DevelopmentNow.com Group
http://www.developmentnow.com