Help users increase productivity by automatically signing up for TechRepublic’s free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday. When you press the command button at the end of that month, you will automatically add the new data to the end of the Hours Worked table in the Access database.Ĭheck out the Microsoft Access archive, and catch up on other Access tips.
Each month, Excel will archive the worksheet and create a new worksheet with the name Hours Worked.xls to collect the new data for the next month. When you press the command button, the Hours Worked table will receive the data in the Excel file. Enter the following code at the prompt:ĭoCmd.TransferSpreadsheet transfertype:=acImport, tablename:="Hours Worked", filename:="C:/Personnel/Hours Worked.xls", HasFieldNames:=True.Click the Event tab and click the On-Click property box.Right-click the Command button and select Properties.Click Cancel to close the Command Button wizard if necessary.Click and drag in the form where you want the tool.Click the Command Button tool in the Toolbox. To accomplish this, right-click on whitespace when you have the Tables tab selected, and you will see the menu in Figure 4-6.Follow these steps to create the command button: The branch office entered this information in an Excel worksheet named Hours Worked. While Access 20 include a wizard for importing data from an Excel file into an Access table, if you have to perform that function periodically, you may want to create a command button that will perform all of the steps of the wizard for you.įor example, suppose you need to import a monthly report of hours worked for all employees in your branch office. Mary Ann Richardson shows you what do to if you have to perform that function periodically. While Access 20 include a wizard for importing data from an Excel file into an Access table, you may want to create a command button that will perform all of the steps of the wizard for you. Use a command button to import Excel data to an Access table