Transfer Spreadsheet - able to limit by data????

unc2plo

Board Regular
Joined
Mar 18, 2002
Messages
148
I have a db that uses transfer spreadhseet to upload some data. Is there a way to limit what data gets brought across? Can I say bring over only items within a certain date range?

This what teh code says now......

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblExcelLoad", Me.cdg1.FileName, True

Thanks,
David
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
57,633
Office Version
  1. 365
Platform
  1. Windows
I would recommend trying to limit before or after the import, not during the import.

There are a number of ways to do it. One way is to import the data into a temporary access table, then create an Append Query that limits the data according to your desired criteria, and then adds those records to your final table.
 

unc2plo

Board Regular
Joined
Mar 18, 2002
Messages
148
oooohh, I like that.

I inherited this db, and it is way too reliant on code which makes it tough to rework.

Thanks - your comment really showed me that I need to look at this a different way vs trying to live within the constraints that it places on me.
 

Watch MrExcel Video

Forum statistics

Threads
1,133,325
Messages
5,658,174
Members
418,430
Latest member
Chlwls808

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
Top