Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I Consolidate an EXCEL Report into a record for ACCESS impo Mike M Excel Discussion (Misc queries) 1 September 16th 09 11:28 AM
Update current record in Access using Excel Noemi Excel Programming 1 February 21st 07 02:38 PM
New record in table in Access from VBA in Excel JCanyoneer Excel Programming 5 March 24th 05 08:26 AM
Importing Access record into Excel using MSQUERY question Harry[_7_] Excel Programming 3 February 14th 05 02:36 PM
Modifying an Access record in Excel John Moll Excel Programming 1 August 1st 03 05:27 PM


All times are GMT +1. The time now is 10:23 PM.

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

About Us

"It's about Microsoft Excel"