I have a form whose objective is as follows:
1. Allow users to select a record (tblExport.ExportID) and then display that records relating records in tblExportMap (relationship on ExportID)
2. Then allow user to edit any or all of the export fields (tblExportMap.ExportFieldI
D or tblExportMap.tblColumn)
3. If necessary rollback/cancel all changes made or save all changes
I originally did this with a continuous form and set the recordsource of the form to
strSQL = "SELECT tblExportMap.ExportNameID, tblExportMap.ExportFieldID, tblExportMap.tblColumn" & _
" FROM tblExportMap" & _
" WHERE tblExportMap.ExportNameID=" & intExportNameID
after the ExportName was selected from a drop down menu
This allowed users to edit the data and add records as needed without any problem. The problem occured in that if a user clicked the cancel button (which ran Me.Undo) the code only undid the most recent records edits (since access adds/edits/etc one record at a time).
What I believe I need is an unbound form that allows a user to add any records needed, edit any records and then with one command button "save" insert or update all of the changes into the table at once. Likewise, a 'cancel' button that discards any edits or inserts.
In the bound version of this form, a new row auto populates after the record is saved. In the unbound version, I cannot get a new row to generate so that a user can create another row of data on the same form.
What is the best approach to auto-add this new record row?