PC Review


Reply
Thread Tools Rate Thread

Auto backup if Spreasheet Transfer Fails

 
 
jeanhurtado@gmail.com
Guest
Posts: n/a
 
      26th Mar 2007
Hi, Folks, I'm Jean and working on my last part of my project (Cycle
Count Dept stand alone system). I'm now programming the backup method
of the database. I have a Excel spreadsheet that it contains the cost
of the part number the dept will use. I have create a table that is
called "Costttable" and a macro that make a transfer from the excel
file to access Costtable. I also have a table that it called
Backupcosttable that it contains the previous contents of the
costtable ( I make update of to cost 2 or 3 times a year). I want to
know how I can code if the spreadsheet transfer fail, the contents of
the backupcosttable transfer to the cost table automatically. Thank
you so much for your effort to help me.




JC

 
Reply With Quote
 
 
 
 
ti976@yahoo.com
Guest
Posts: n/a
 
      27th Mar 2007
On Mar 26, 7:09 am, jeanhurt...@gmail.com wrote:

> costtable ( I make update of to cost 2 or 3 times a year). I want to
> know how I can code if the spreadsheet transfer fail, the contents of
> the backupcosttable transfer to the cost table automatically. Thank
> you so much for your effort to help me.
>
> JC


Error trapping comes to mind. Assuming you run the excel trnsfer in a
vba module, you can write an error trapping rooutine to catch any
error in the transfer and append the old data back:

sub subX()
....
on error goto err_X 'set error trapping
transferdatabase ..... 'code to transfer excel data into table
Costtable
on error goto 0 'turn off error trapping
....'more coding as needed

exit sub

err_X:
'code to clear costtable, ex: currentdb.execute "Delete * FROM
Costtable"
'code to append old data into costtable, ex: currentdb.execute "Insert
into costtable select * from backupcosttable"
'msgbox to informed you of error (optional)

end sub



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup Auto Text for transfer to another computer hockeymomz Microsoft Word Document Management 1 23rd Jun 2009 03:24 PM
Transfer to Vista -- dictionary and auto-correct did not transfer Gordon Microsoft Word New Users 2 5th Sep 2008 05:49 PM
auto backup fails, manual backup ok (mgf) Mike F from TN Windows Vista General Discussion 4 24th Jan 2008 11:17 AM
Complete PC Backup fails, restore fails differently! =?Utf-8?B?SGFycnkgQ29pbg==?= Windows Vista Performance 5 19th Nov 2007 09:42 PM
XP Backup Scripts not found - Automatic backup fails Tom Windows XP General 0 7th Jul 2004 08:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:59 PM.