Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Record in Access Using Excel
Hi
Would someone be able to provide the code to find a record in an Access table using data in excel. ie have an order number in excel and I want to find the record in the Access database for the order number so I can update the record for that order in Access table. thanks Noemi |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find Record in Access Using Excel
Here is some code you can modify to fit your specific database, table,
etc. You need to check Microsoft DAO x.x Object Library using the menu Tools | References. Sub ModifyAccessRecord() Dim db As Database, rs As Recordset Set db = OpenDatabase("C:\FolderName\DataBaseName.mdb") Set rs = db.OpenRecordset("TableName", dbOpenTable) Do If rs.Fields("FieldName1") = "something" Then rs.Edit rs.Fields("FieldName2") = "something else" rs.Update ' stores the new record End If rs.MoveNext Loop Until rs.EOF rs.Close Set rs = Nothing db.Close Set db = Nothing End Sub HTH, Merjet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I Consolidate an EXCEL Report into a record for ACCESS impo | Excel Discussion (Misc queries) | |||
Update current record in Access using Excel | Excel Programming | |||
New record in table in Access from VBA in Excel | Excel Programming | |||
Importing Access record into Excel using MSQUERY question | Excel Programming | |||
Modifying an Access record in Excel | Excel Programming |