You could try the me.undo command. I rarely use the Unload event but instead will put code in a button and control how the form works via it's properties. For example, I'll design my forms as popup = true and modal = true and control the form's closing via a button. (and also set the form's Control Box property to false so the user can't bypass by clicking the X). This gives me much more control over how I want the form to perform.
Otherwise, without declaring a bunch of variables, another option is to simply make the form unbound and write a function to write the data to the table again, when a button is pushed (although this does require a bit of coding for writing 20-30 fields to the table.)
If you want to see an example of how I prevent users from closing the form (and closing MSAccess!), there's a neat little trick I use - see here: http://www.dbforums.com/6274790-post20.html or here: http://www.dbforums.com/6332819-post68.html
Notice in the examples, I open a 'MainFormBackground' and maximize it as my startup form. In the OnOpen event of the MainFormBackground, I'll then open my popup/modal menu form. This essentially disables the MSAccess top menus (but does allow the menu when print previewing.) I use this trick all the time and it works very well. Plus, I like the ability of total control on the flow of the program and forms via using popup/modal forms.
For an unbound form example: http://www.dbforums.com/6452958-post100.html
for additional form controlling features (and making some neat looking form designs), see here: http://www.dbforums.com/6301669-post51.html
Last edited by pkstormy; 04-07-10 at 22:55.
Expert Database Programming
MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)