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
Expand|Select|Wrap|Line Numbers
- Public Shared WithEvents DSCust As New InvoiceWhiz.dsCustomers
- Public custForm As New customerForm
- Public invForm as new invoiceForm
[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.htm
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com