Checking for errors in spreadsheet to be imported to a table

kjharve

Board Regular
Joined
Jan 4, 2006
Messages
206
Hi,

I am setting up a database for the company I work for. The database will be fed information from various departments. Each of these departments will have to populate spreadsheets. Some will be done manually, others by existing computer systems.

Potentially there could be errors in the spreadsheets, there might be typographical errors, duplicate records or key violations etc. As far as I can see I have a few options:

1.) Use the TransferSpreadsheet function and let Access worry about errors but risk some data not being transferred.

2.) Write the data to a temporary table first and then check each record before writing it to the actual table.

3.) Write some code in Excel VBA which uses ADO to check for errors in the spreadsheet so that when it is imported I can be confident no errors exist.

What method is generally employed in this situation? And are there any pitfalls I need to be aware of?

Advice appreciated!

PS - Sorry for the "essay-style" question!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Being that you can't know ahead of time what types of errors will be found, I would use essay entry #2 first. This would allow me to at least see what I'm up against. I would make a report of errors and report them to each dept head to see if there were some sort of action plan that could be implemented at that level (most probably not). Based on my findings, I may find it easier to write VBA against the temporary table.

I don't think essay entry #1 is a good solution... #2, then #3 is the way to go. IMHO
 
Upvote 0
You're right, #1 is definitely the least preferred. I would need to rely on the database user to correct errors and re-import any data that got left out - not likely to happen.

The only thing that puts me off writing to a temporary table is that my Excel VBA skills are far better than my knowledge of Access.
 
Upvote 0
Well, then being that you're more comfortable with VBA in Excel, I'd go through door #3 then.

Although, I think you would get more out of VBA for Access... my opinion... and what you know in Excel VB, can quickly and easily be transported to Access VBA. Little differnces, but the concepts are exactly the same.
 
Upvote 0
Kev

Why not eliminate the errors in the spreadsheets by using things like Data>Validation...?
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,272
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top