Use an Unbound Microsoft Access Form for Temporary Data Entry
Question details
Collect values in a Microsoft Access form and save them to multiple tables only when the user submits them.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- A user needs a temporary data-entry form that creates related table records after validation.
- Observed behavior
- Form controls hold the entered values until the user submits or closes the form.
Identify the target tables, required fields, and relationships, including any AutoNumber primary key needed by a related table. Make sure you can edit the form and its VBA code in Access.
Save unbound form values to related tables with DAO
Use this approach when entries should remain temporary until the user clicks Submit.
Unbound controls hold values while the form is open, so separate VBA variables are generally unnecessary. Closing the form without running the save code discards those values.
Open the form in Design View. In the Property Sheet, leave the form's Record Source blank, then add input controls and leave each control's Control Source blank.
Add a button in Design View. On its Property Sheet's Event tab, set On Click to [Event Procedure] and click the build button to open the VBA editor.
In the button's Click procedure, check the required controls using their names, such as Me.txtName. If a value is missing or invalid, display a message and exit the procedure before writing records.
In the same procedure, open DAO recordsets for the target tables. For each record, call AddNew, assign the appropriate control values to fields, and call Update. If a related record needs a newly generated AutoNumber, use the first recordset's LastModified bookmark after Update to retrieve the key before adding the related record.
For tables that support transactions, use the DAO Workspace BeginTrans before writing and CommitTrans after all updates succeed. Add error handling that calls Rollback if a transaction is active, reports the error, and closes the recordsets.

Use WPS Office for Documents and Spreadsheets
WPS Office is a free, lightweight alternative for everyday documents, spreadsheets, and presentations. Its familiar interface and Microsoft Office format compatibility make it easy to move common files between suites. Microsoft Access is still needed for the unbound form and DAO workflow described above.

Frequently Asked Questions
Do I need VBA variables for every unbound control?
Usually not. In the Submit button's Click procedure, read values directly from named controls, such as Me.txtName. Use variables when they make validation or calculations clearer.
What happens if someone closes the form without submitting?
Values in unbound controls are discarded when the form closes, provided no other form event or VBA code saves them.
Can I use an INSERT query instead of a DAO recordset?
Yes. In the Submit button's Click procedure, execute parameterized INSERT INTO queries after validating the controls. Supply parameters for the control values and handle errors before reporting success.
How do I link a new child record to an AutoNumber parent?
Add and update the parent record first. In DAO, move to the recordset's LastModified bookmark, read the generated primary key, and assign it to the child record's foreign-key field before updating the child.




