same OleDB datasets between two forms?

  • Thread starter Thread starter cgchris99
  • Start date Start date
C

cgchris99

Guest
How can I use the same OLE db datasets between two forms.

I have the main form then I have a lookup form. The lookup allows the user to search through the database and select a record.

I then fill the dataset that is on the main form and the fields update fine. However, when I make a change to a field on the main form and attempt to save the data using myadapter.update(....)

It doesnt work. I am wondering if it is because the adapter on the main form is not the same as the one on the lookup form.

Any ideas?

Thanks
 
Either declare the adaptor as Shared in a separate class (similar to a Global variable in Visual Basic 6) or overload the forms constructor, passing it the adaptor when you load the second form.
 
Back
Top