Hi, Im trying to write a VBA macro that will do a find and replace a record with in multiable tables, I know you can do a query which will replace values with (Replace([YourFieldName], "%" , "" )) but I need to apply the record change over multiable tables where the record exists, Below is what I have done I'm familiar with it working in excel and have no issues there, but don't know how to select tables before running the macro search.replace function on it to test if it will work in the same scenario.
----------------------------------------------
OldAsset = Me.txtOldAsset & ""
NewAsset = Me.txtNewAsset & ""
If OldAsset = "" Then
MsgBox "No Old Asset Number"
End
Else
If NewAsset = "" Then
MsgBox "No New Asset Number"
End
Else
MsgBox "Start Asset Number Change"
Selection.Replace What:=OldAsset, Replacement:=NewAsset, LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
End If
End If
End Sub
-------------------------------------------------
This is my current query with tables