DavidT_macktool
Well-known member
My Visual Studio .NET project involves using the dataform wizard to create a form DataForm1 displaying an SQL2000 database table in a dbgrid. (no Problem)
Then I add a second dataform wizard form DataForm2 to display the same database table in the single record textbox format. (no problem)
I want to add a button on DataForm1 to access DataForm2 and have DataForm2 load the current record from the datagrid on DataForm1. Really simple - I thought.
Dim frmDF2 AsNew DataForm2
frmDF2.ShowDialog()
What I need:
Do I need to recode DataForm2 btnLoad_Click procedure to display the record in focus on DataForm1 and then copy it to the DataForm2_Load procedure?
Do I need to call DataForm2 in a different manner?
Both forms were created with an instance of objdsPart on them - this is the dataset I want to use. The only OleDbDataAdapter and OleDbConnection reside on DataForm1. Is This Correct?
Eventually I would like to add a doubleclick method to the dbgrid to display DataForm2 also.
Delphi3 did this automatically by keeping the dataset open and in focus throughout the project. Visual Studio .net does not behave this way. The dataset is actually a table in memory? Can I reference the record position from another form? Do I reference the OleDBDataAdapter1 or the objdsPart dataset? I will need this knowledge for just about every table that I access. Any tutoring would be greatly appriciated.
Then I add a second dataform wizard form DataForm2 to display the same database table in the single record textbox format. (no problem)
I want to add a button on DataForm1 to access DataForm2 and have DataForm2 load the current record from the datagrid on DataForm1. Really simple - I thought.
Dim frmDF2 AsNew DataForm2
frmDF2.ShowDialog()
What I need:
Do I need to recode DataForm2 btnLoad_Click procedure to display the record in focus on DataForm1 and then copy it to the DataForm2_Load procedure?
Do I need to call DataForm2 in a different manner?
Both forms were created with an instance of objdsPart on them - this is the dataset I want to use. The only OleDbDataAdapter and OleDbConnection reside on DataForm1. Is This Correct?
Eventually I would like to add a doubleclick method to the dbgrid to display DataForm2 also.
Delphi3 did this automatically by keeping the dataset open and in focus throughout the project. Visual Studio .net does not behave this way. The dataset is actually a table in memory? Can I reference the record position from another form? Do I reference the OleDBDataAdapter1 or the objdsPart dataset? I will need this knowledge for just about every table that I access. Any tutoring would be greatly appriciated.
Last edited: