thanks! Hey if I want to delete the data from the table one after I've ran the append would I insert it in this code as well?
"Stuart McCall" wrote:
[Quoted Text] > "Troy" <Troy[ at ]discussions.microsoft.com> wrote in message > news:0AB8C428-8DEC-4152-9594-5AF92688F2AA[ at ]microsoft.com... > >I have a form that enters data into a table(table1). I would like to add > > some code to a button that would append that data to another > > table(table2). > > I know how to create a append table, but I would like some assurance that > > when I append that all the data would not be lost. Is there some error > > code > > I can use that would assure me of this? What is the best approach? > > The best approach when dealing with critical data is to back it up first. > Leave the backed up table alone until you're certain it has all appended ok. > Then it can be either be archived into a new db file or deleted. > > That said, the approach I would take to appending the data is to use the > Execute method inside an error-trapped procedure, like this: > > On Error Goto Trap > > CurrentDb.Execute "MyAppendQuery", dbFailOnError > > ExitPoint: > Exit Sub > > Trap: > MsgBox Err.Description > Resume ExitPoint > > >
|