G
Guest
I have three tables that are linked to excel spreadsheets. For each month
there will be three spreadsheets and I want the user to click on a button to
relink to the appropriate one. What is the best way to accomplish this?
I tried this, which will create a new table. However, I need to keep the
tables linked because of their relationship.
Dim strFilter As String
Dim strInputFileName As String
Dim strDefaultDir As String
Dim strTableName As String
'Set filter to show only Excel spreadsheets
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xls)")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
strTableName = Forms!frmMain!cboTablesImport
'Get the File Name
strDefaultDir = "C:/"
Me.Repaint
If strInputFileName <> "" Then 'User Clicked CANCEL
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9,
strTableName, strInputFileName, True
End If
there will be three spreadsheets and I want the user to click on a button to
relink to the appropriate one. What is the best way to accomplish this?
I tried this, which will create a new table. However, I need to keep the
tables linked because of their relationship.
Dim strFilter As String
Dim strInputFileName As String
Dim strDefaultDir As String
Dim strTableName As String
'Set filter to show only Excel spreadsheets
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xls)")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
strTableName = Forms!frmMain!cboTablesImport
'Get the File Name
strDefaultDir = "C:/"
Me.Repaint
If strInputFileName <> "" Then 'User Clicked CANCEL
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9,
strTableName, strInputFileName, True
End If