Hi guys,
I am new to VBA and I'm trying to automate a procedure that imports 4 .csv files in a specific folder to the SQL database.
I have a code in which I have 4 command buttons and in each 4, I am picking the files and then importing them to SQL. However, I wanted to know if there is a way in which I can have just 1 command button that picks all the .csv files from that specific folder and then imports them to SQL. Assume the folder name is Database in the following path: Y:\Data\Database
I have the following import button code that converts the local path to SQL server path and all other sorts of functions to import the data to SQL server. (fName1...fName4 are the TextBox values for the 4 file paths currently being picked by the user)
Please Login or Register to view this content.
Any help on how to grab all 4 .csv files in a folder with a command button and then importing them would be appreciated!
Thank you so much!
Bookmarks