E
excel_hari
Hi,
I have 2 needs:-
a) I want to import excel data to an existing table in my DB. While
doing so, I want to delete the existing records in the table. If I use
the following code (Pinched from the NewsGroup)
Sub TransferData()
Dim MyPath As String
Dim MyFile As String
MyPath = "C:\Hari\Assorted stuff\For Mohan\"
MyFile = "Copy of April06Fnubextract .xls"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, _
"OSRM_Table", MyPath & MyFile, True, "Report 1!"
End Sub
Then, the new data gets stacked below existing data. How to avoid this
problem?
b) Suppose I want to import data from Excel in to a table which doesnt
exist in my DB, then how to do it. Basically I want a code which culd
mimic the Getexternal data in File menu. Is this possible?
Also, is it possible to see the code behind a macro in Access. Iam new
to Access and work on excel only and its strange that one cannot record
macros the way one does in Excel. In excel one could see the code for
recorded macros and customize accordingly.
Regards,
HP
India
I have 2 needs:-
a) I want to import excel data to an existing table in my DB. While
doing so, I want to delete the existing records in the table. If I use
the following code (Pinched from the NewsGroup)
Sub TransferData()
Dim MyPath As String
Dim MyFile As String
MyPath = "C:\Hari\Assorted stuff\For Mohan\"
MyFile = "Copy of April06Fnubextract .xls"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, _
"OSRM_Table", MyPath & MyFile, True, "Report 1!"
End Sub
Then, the new data gets stacked below existing data. How to avoid this
problem?
b) Suppose I want to import data from Excel in to a table which doesnt
exist in my DB, then how to do it. Basically I want a code which culd
mimic the Getexternal data in File menu. Is this possible?
Also, is it possible to see the code behind a macro in Access. Iam new
to Access and work on excel only and its strange that one cannot record
macros the way one does in Excel. In excel one could see the code for
recorded macros and customize accordingly.
Regards,
HP
India