I modified some code I borrowed from the MS Northwinds Training DB as follows.
My goal is to perform find/replace functions much like in Excel. The above code works, however, I have not been able to incorporate wildcard statements, i.e, (In English) Find Sales* and Replace with Marketing*
Any help would be appreciated. Please don't bring up the discussion of Update queries.
Thanks
Code:
Sub ReplaceMe()
Dim MyDB As DAO.Database
Dim MyRS As DAO.Recordset
Dim MyTable
MyTable = "Employees"
Set MyDB = CurrentDb
Set MyRS = MyDB.OpenRecordset(MyTable)
MyRS.MoveFirst
Do Until MyRS.EOF
If MyRS![Job Title] = "Sales Representative" Then
MyRS.Edit
MyRS![Job Title] = "Marketing Representative"
MyRS.Update
End If
MyRS.MoveNext
Loop
End Sub
My goal is to perform find/replace functions much like in Excel. The above code works, however, I have not been able to incorporate wildcard statements, i.e, (In English) Find Sales* and Replace with Marketing*
Any help would be appreciated. Please don't bring up the discussion of Update queries.
Thanks