Form navigation to related records - vb.net

sanand

New member
Joined
Jul 7, 2005
Messages
4
Programming Experience
3-5
Hi experts,

I have 5 forms in my project that are related to one another.
Like ms access, I like to navigate from one record id 125 in Form1 to
the related record Id 125 in form2.

Example:
form1 is a customer form with custID =125, and other fields.

On the click of a button (btnOrders) on form1, I woild like
to open form2 with a related record of custID 125.

How to accomplish there?
Any assistance is appreciated.

TIA
sanand
 
There are many ways. You could pass the custID as an argument to the form2 constructor and then have form2 execute a query against your database using that custID. If you already have the data, you could pass a reference to or a Copy of the DataTable with its DefaultView.RowFilter property set appropriately to display only the desired records.
 
Synchronizing forms/records

Thanks for your response.
I am pretty much familiar of the code in ms access,
but still leanring vb.net.

I will really appreciate if you provide me an example of
coding this filter technique.

Thanks again.
 
If you want to filter the rows that a bound control will display, you can set the RowFilter property of a DataTable's DefaultView property to any valid SQL "where" clause, e.g.:
VB.NET:
myDataTable.DefaultView.RowFilter = "custID = 100"
would cause any control bound to myDataTable to only diplay rows that had a value of 100 in the "custID" column.
 
Back
Top