I have a routine to do using VB.NET 2003 and ADO that is a little unusual (at least I think it is unusual). I have been struggling with this all week and need to show my boss some progress very soon.
I have two tables in a MS Access Database: MainTable and SubTable. MainTable contains about 20 columns, SubTable contains 5 of the columns from the MainTable plus 2 additional columns one for a raw number (RAW) that is generated and the other for a scaled number (SCALED) based on a calculation done to the RAW number. So the SubTable is not just a subset of MainTable.
The user can make a lot of changes to the MainTable before this routine runs so I need to do a few things in a certain order:
1. I need to query the MainTable to get just the columns I want for every record in the MainTable
2. I need to delete all of the records in the SubTable because the user may have changed the MainTable since the last time this was run.
3. I need to add new records to the SubTable based on the query of the MainTable in Step 1
4. I need to add the data for the RAW number to every record in the SubTable
5. I need to add the SCALED number to every record in the SubTable
6. I need to display the contents of the SubTable in a DataGrid.
I think all of this could be done in a single form code but I am LOST!
Please help - Examples would be valuable