Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing multiple datasets through multiple forms 1

Status
Not open for further replies.

Vandy02

Programmer
Jan 7, 2003
151
0
0
US
I have a dataset called now that consists of three tables.
(now, "EMP")
(now, "DEPT")
(now, "SAL")
These are filled from remote db.

I am able to click within a datagrid (consisting of "DEPT") and then edit the values on a separte form with text boxes. This works very well through the use of managerbase and currency manager. What I would like to do is have the second form display a grid with "EMP" data along with the editable fields from the "DEPT".

Form 1:

DEPT GRID:

DEPTNO LOCATION


Click on a record and display second form

Form 2:

DeptNo editable field
Location editable field

EMP GRID:

EMPNAME DEPTNO

In the same fashion I will be doing the same with respect to "EMP" and "SAL" on a third form....

I guess that what I am trying to do is pass multiple tables or dataviews to forms...

Or do I have another way to access the datasets through multiple forms?

Thanks
 
I don't know if this is the best way...
If I need to use a dataset in multiple forms, I declare it as a public dataset in a module.
 
would you be able to provide me short example of how to do that?

this sounds like the better situation for sure
 
I have a module called FormFuctions that I use for any variables, funtions, or subs that I need to access from multiple forms.
Code:
Module FormFunctions
    Public DataSet1 As New DataSet
End Module

Then, in the forms, you just refer to the dataset normally. For example, to bind your datagrid:
Code:
DataGrid1.SetDataBinding(DataSet1, "myTableName")

Hope this helps.
 
thanks...

i also tried something else that seemed to work...

in the main form:

Public now as dataset

then I made the private sub that populated the dataset to public...and it carried over..

thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top