Thank you John.
I'm sorry if I mislead you.
I didn't write the actual application yet, first I try to figure how the app
will run and what functions I will need and then I write it.
sorry I misread your post - that's pretty clear actually!
The isuue is that right now, on the spreadsheet there are endless columns
and more than 25000 entries, I thought to move these process to access will
make it easier in terms of queries, sorting and reports. Please correct me
if I'm wrong.
Well... again: Excel is a spreadsheet, a good one. Access is a
relational database. They are NOT EQUIVALENT. Yes, you'll use
normalized Tables, Queries, Reports, and almost surely some VBA
modules (called "macros" in Excel jargon, Access macros are something
else). You can probably accomplish what you need to do in Access, but
to do so you will have to rethink *how* you are doing it, and how the
database must be structured to allow it.
I tried the "TransferSpreadsheet" function and most of the data converted
but I had some conversion errors.
Access has "strong data typing" and Excel doesn't; this can often
cause such problems when you're moving data from Excel into Access.
For example in Excel you could very plausibly have a column of numbers
with a few rows containing "N/A" (not available). No problem, Excel
will ignore this text string in calculations; but it will cause Access
to choke with an error when you attempt to load it into a Number
field.
What is the best way to avoid these error?
Clean the data; or deal with the errors as they occur, manually or in
VBA code.
Second question:
The data come in XLS format, and has to be add to the application and avoid
dups, what is the best way to do that?
I'd suggest creating an Access table with fields of the appropriate
datatypes and sizes; define a unique Index on those fields which
constitues a "dup" (see below!!!); link to the spreadsheet and run an
Append query to migrate the data into the table. Duplicates will be
removed in the process, with a warning message (which can be
suppressed if you so choose).
Duplicates are tricky. If you have people's names, bear in mind that
names are NOT unique - I know three Fred Browns, right here in the
little town of Parma.
I tought to create macro that convert the xls file into a temp table, run an
append query and delete the temp table, but how do I avoid dups or how do I
let the user choose which one to keep and which to delete?
You can prevent dups by setting a unique Index. You can find dups
using a "find duplicates" query, and present them to the user on a
Form to allow the user to decide. Depends on the business need!
John W. Vinson[MVP]