title: how to write a macro in access 2010 to import data of excel sheet to access 2010 table?
body: <p>I want to write the Code which imports data from an excel table to a access table on a button click presents in a form.Because I am new in MS Access programming so pls explain answer briefly.</p>
  
  <p><strong>Edit:-</strong></p>
  
  <p>One thing i forgot to write that i am using webform not a simple form.At one forum i find that import can be achieve by using TransferSpreadSheet macro but i didn't get it in access 2010 macro commands.</p>
  
  <p>Please give me some direction so that i can solve my problem.
  Thanx in advance.</p>
  
  <hr>
  
  <p>I have written the below code in my module                         </p>
  
  <pre><code>Private Sub ImportButton_Click()
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "imported data",    "C:\Documents and Settings\himanshu\Desktop\Sales Report1.xls", True
  End Sub                                                            
  </code></pre>
  
  <p>however when i click on button nothing happend. Is there anything i  am mising?</p>