Here is the scenario. I have frmMain which has a btnDepts_Click event. On that same form I have a textbox txtCustomerActive.
On my second form frmDepartments, I have set a ScalarQueryDepartments like thus using DataGridView:
SELECT Customer, Dept, Name FROM Departments Where Customer = ?
My question is, how do I get the value from frmMain textbox to my frmDepartments form where my db is setup. I know I can do txtDeptCustomer.Text = frmMain.txtCustomerActive.
Text in frmDepartments load event, but how do I capture that value to pass to db. Do I just declare a variable in frmDepartments and pass that?
I am using this code at the moment which catches the value I need, but how do I now query database with that value and display only those values in grid.
Me.DepartmentsTableAdapter.Fill(Me.StorageDataSet3.Departments) Dim customer As Object = frmMain.txtCustomerActive.Text txtDeptCustomer.Text = CType(customer, String)
Any help to a new user would be very much appreciated. Thanks