Kathrynlewis
Technical User
I have created a database, have a command button but can't figure out VBA Code to select a file from the shared drive.
I would like to be able to click Command1 button
and be prompted to select file from specific folder on shared drive so that I can import it. Anyone know what the string is for this? This is what I have- but not working. What's wrong?
This works to import:
Private Sub Command1_Click()
DoCmd.TransferSpreadsheet (acImport), acSpreadsheetTypeExcel7, "AIRTEST", "L:\Marketing\Communications\Promos\Promos 2004\RegionOrders\AIRTEST.xls", -1
DoCmd.OpenTable ("AIRTEST", acViewNormal, acEdit
End Sub
I tried to make it more specific with this, but doesn't work:
Private Sub Command1_Click()
Dim fn As String
fn = InputBox("Enter Path and File Name", "File Import"
End Sub
I would like to be able to click Command1 button
and be prompted to select file from specific folder on shared drive so that I can import it. Anyone know what the string is for this? This is what I have- but not working. What's wrong?
This works to import:
Private Sub Command1_Click()
DoCmd.TransferSpreadsheet (acImport), acSpreadsheetTypeExcel7, "AIRTEST", "L:\Marketing\Communications\Promos\Promos 2004\RegionOrders\AIRTEST.xls", -1
DoCmd.OpenTable ("AIRTEST", acViewNormal, acEdit
End Sub
I tried to make it more specific with this, but doesn't work:
Private Sub Command1_Click()
Dim fn As String
fn = InputBox("Enter Path and File Name", "File Import"
End Sub