Hi, all! I have a form with three command buttons. The second two preview reports. The first will automatically import a spreadsheet to Access and append to a table. My problem is how do I make the file name in the TransferSpreadsheet Method variable? I would like the system to request a file name or allow browsing to the specific file and then insert the file name in "stFileName" (See below). Thanks for your help!
Option Compare Database
Private Sub Command3_Click()
Dim stFileName As New Worksheet
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
"Assignment Check", "stFileName", True
End Sub
Option Compare Database
Private Sub Command3_Click()
Dim stFileName As New Worksheet
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
"Assignment Check", "stFileName", True
End Sub