Importing Excel into Access 2016

ajdajd used Ask the Experts™
I'm using a macro in Access 2016 to import an excel file.  The user inputs the filename into a text box on a form and I need to pass that name to the field name the ImportExportSpreadsheet step in the macro.  It seems no matter how I format the name of the form/field it doesn't work.  I've tried [forms]![formname]![filename] but the macro says it can't find the file and generates a 2950 error.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Can you upload sample with this macro?
You can use designer:
designerPress button on the right size of field with file name, browse to you form and select field
You can also add it manually. Syntax like:
Scott McDaniel (EE MVE )Infotrakker Software
Most Valuable Expert 2012
Top Expert 2014
Make sure the database is in a Trusted Location on the end user machine. You can add Trusted Locations in various ways:


I was missing the = sign in the expression.  Looking at your screen shot solved my issue.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial