Filter BindingSource with Variable

limalicas

New member
Joined
May 21, 2005
Messages
2
Programming Experience
Beginner
Hi, I hope someone can help - I'm fairly new to all this.

I'm using Visual Studio 2005 Beta 2, VB .NET and .NET 2.0. Winform application, MS Access backend.

I'm using a BindingSource to ensure a collection of databound controls on Form1 are populated with data from the same row of the database. That's easy enough, but by design, the controls on Form1 are read-only.

I need my users to be able to click an "Edit" button which launches Form2.

Form2 should have its controls populated with data from the row in the database that has the ID value of the selected record in Form1.

How do I first set a public variable, stuff it with the RecordID value from Form1, and then use that variable to filter a BindingSource control in Form2?

I've done the following to create and set the value of the public variable - this is placed in the Click event of the Edit button;

VB.NET:
Dim filtervalue As Integer 
filtervalue = TextBox2.Text

(For clarity, TextBox2 is populated with the RecordID value)

Really appreciate some idiot-proof sample code from you experts!

Thank you
Liam
 
Back
Top