If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
how do I update a table automatically
I have a database I want to update with information from excel automatically
but only if I choose to per record. So as I type a field in a form I want it to find a matching field in the excel spreadsheet and automatically fill out the rest of the fields in the form at which point I can edit the information or use the selected information by pressing the *next record button. Any ideas would be greatly appreciated. |
#2
|
|||
|
|||
how do I update a table automatically
Hi Don
The best way to search for a corresponding row in an Excel worksheet is to import the sheet as a linked table: DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel8, _ LinkedTableName, ExcelFilePath, True, WorkSheetName & "$" You can then open a recordset based on LinkedTableName and find the required row (record) in the recordset using the FindFirst method. Then you can update the local table with the Excel data extracted from the current record of the recordset. After you have finished, don't forget to close the recordset and delete the linked table, or else the Excel file will remain locked. -- Good Luck :-) Graham Mandeno [Access MVP] Auckland, New Zealand "Don" wrote in message ... I have a database I want to update with information from excel automatically but only if I choose to per record. So as I type a field in a form I want it to find a matching field in the excel spreadsheet and automatically fill out the rest of the fields in the form at which point I can edit the information or use the selected information by pressing the *next record button. Any ideas would be greatly appreciated. |
Thread Tools | |
Display Modes | |
|
|