Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Opens a table-type recordset and then moves throug...
Website:
http://www.a1vbcode.com/
Submitted:
2/13/2000
Version:
VB3
Compatibility:
VB3,4,5,6
Category:
Databases
Views:
12319
Opens a table-type recordset and then moves through the recordset using the .Edit method to edit a field in the table.
Declarations:
none
Code:
Sub EditRecordset() Dim dbs As Database, rst As Recordset Dim strPath As String Set dbs = OpenDatabase(strPath) Set rst = dbs.OpenRecordset("Employees", dbOpenTable) With rst ' Set current index. .Index = "LastName" ' Locate first record. .MoveFirst ' Begin loop. Do Until .EOF If !Title = "Manager" Then ' Enable editing. .Edit ' Change title. !Title = "Executive" ' Save changes. .Update End If ' Locate next record. .MoveNext ' End of loop. Loop ' Close recordset. .Close End With dbs.Close Set dbs = Nothing End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement