A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how do I update a table automatically



 
 
Thread Tools Display Modes
  #1  
Old August 25th, 2008, 10:00 PM posted to microsoft.public.access.tablesdbdesign
Don
external usenet poster
 
Posts: 992
Default 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  
Old August 25th, 2008, 10:32 PM posted to microsoft.public.access.tablesdbdesign
Graham Mandeno
external usenet poster
 
Posts: 593
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.