All, I have code using TransferSpreadsheet within VBA code.
But, I would like the folder location to vary, depending on the folder's name keyed in by the user into a form. One time, he may need to link to files in Folder1, the next day he would link to Folder2, and so on.
So, trying something here, Access VBA does not like this code:
Do.Cmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel9, "One", "E:\" & "Forms![SelectForm]![Foldername]" & "\" & "One.xls", True
Access error says this is not a valid path, so obviously, my problem is the Forms![SelectForm]!Foldername] reference.
Would anyone know how to do this? To insert a variable folder name into this VBA code?
Thanks in advance to anyone who can help, thanks.
But, I would like the folder location to vary, depending on the folder's name keyed in by the user into a form. One time, he may need to link to files in Folder1, the next day he would link to Folder2, and so on.
So, trying something here, Access VBA does not like this code:
Do.Cmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel9, "One", "E:\" & "Forms![SelectForm]![Foldername]" & "\" & "One.xls", True
Access error says this is not a valid path, so obviously, my problem is the Forms![SelectForm]!Foldername] reference.
Would anyone know how to do this? To insert a variable folder name into this VBA code?
Thanks in advance to anyone who can help, thanks.