brunces
Registered User.
- Local time
- Today, 12:43
- Joined
- Sep 12, 2004
- Messages
- 45
Friends,
Please, help me with this...
I have two files: main.xls and main.mdb.
main.xls has one single sheet (SheetData)
main.mdb has one table called (tblData)
I have to LINK main.xls (SheetData) to main.mdb (tblData). To do this, I have a form with a button (bttLinkFile).
The point is... When I click the button, Access understands that there's already a table called "tblData", so it creates a new table (tblData1), instead of just linking that existing table "tblData" to the Excel file. Shouldn't it just LINK them? I need them to be linked!
If I use "acImport" instead of "acLink", it works. It imports all data from the spreadsheet into the table tblData.
"tblData" has the same fields of "SheetData" (I created tblData linking SheetData for the first time).
So, how can I link them, avoiding Access to create a new table?
Before you ask, I need to link main.xls several times because it's not a fixed file with fixed data. I export main.xls file from another Excel file I work at. So, I eventually have to link it again and again.
I hope you can help me. Thank you for your attention, guys.
Hugs,
Bruce
Please, help me with this...
I have two files: main.xls and main.mdb.
main.xls has one single sheet (SheetData)
main.mdb has one table called (tblData)
I have to LINK main.xls (SheetData) to main.mdb (tblData). To do this, I have a form with a button (bttLinkFile).
Code:
Private Sub bttLinkFile_Click()
DoCmd.TransferSpreadsheet acLink, , "tblData", Application.CurrentProject.Path & "\main.xls", True
End Sub
The point is... When I click the button, Access understands that there's already a table called "tblData", so it creates a new table (tblData1), instead of just linking that existing table "tblData" to the Excel file. Shouldn't it just LINK them? I need them to be linked!
If I use "acImport" instead of "acLink", it works. It imports all data from the spreadsheet into the table tblData.
"tblData" has the same fields of "SheetData" (I created tblData linking SheetData for the first time).
So, how can I link them, avoiding Access to create a new table?
Before you ask, I need to link main.xls several times because it's not a fixed file with fixed data. I export main.xls file from another Excel file I work at. So, I eventually have to link it again and again.
I hope you can help me. Thank you for your attention, guys.
Hugs,
Bruce
Last edited: