Maximum/Minimum number of records on import

S

shmoussa

My database is set to import a CSV. Is there a way to not allow a CSV
file to be imported, and bring up a message box if the CSV file has
less than 30 records or more than 500 records? I think it involves
something to do with Select Case, but I'm not quite sure where to take
it from there.
 
G

Guest

Rather than a direct import, set it up as a Link. Then you can address the
file like a recordset and determine whether or not to do the import. Then do
the import with a query.
 
S

shmoussa

Thank you for your response. I already have the actual importing
process working perfectly the way I want it. But I was wondering
whether or no there was some type of code to stick in there, to tell
it not to allow importing of a CSV file with less than 30 or more than
500. If there is a code that I can just add, let me know. Thank you
again.
 
D

Douglas J. Steele

Dave's suggestion is the most reasonable one.

Link to it, then do a count on how many rows are in the linked table. If the
count is outside of the allowable range, display the message. If not, do
your import.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top