Hi,
I am trying to use the VBA function Replace() in Access 2000 to replace field values in a table based on values in a field of another.
Example Tables
TblData (approx 40,000 records)
TagNo ProcessData
1PT5 100Kpa
2PCV04 10KPA.G
1JB12 Yellow
1PT07 7psi
5PG03 12kPaa
tblAlias (approx 400 records)
UOM Alias
KPa(a) kPaa
KPa(g) KPA.G
KPa(g) kpag
PSI psi
PSI psig
Basically I am trying to get Access to search the field ProcessData in table tblData for all occurrences of the values in field Alias in table tblAlias. So the code would search for the string "kPaa" in all ProcessData records and replace with Nulls, then search all ProcessData records for KPA.G and replace with Nulls until all occurrences of aliases listed in tblAlias have been replaced by nulls in tblProcessData. Giving me the result below:
Desired Result
TblData
TagNo ProcessData
1PT5 100Kpa
2PCV04 10
1JB12 Yellow
1PT07 7
5PG03 12
I have searched the forums for an answer for over 2 hours for a similar problem to no avail. Any help would be greatly appreciated. I am definitely not a VBA guru but know my way around access pretty well.
I am trying to use the VBA function Replace() in Access 2000 to replace field values in a table based on values in a field of another.
Example Tables
TblData (approx 40,000 records)
TagNo ProcessData
1PT5 100Kpa
2PCV04 10KPA.G
1JB12 Yellow
1PT07 7psi
5PG03 12kPaa
tblAlias (approx 400 records)
UOM Alias
KPa(a) kPaa
KPa(g) KPA.G
KPa(g) kpag
PSI psi
PSI psig
Basically I am trying to get Access to search the field ProcessData in table tblData for all occurrences of the values in field Alias in table tblAlias. So the code would search for the string "kPaa" in all ProcessData records and replace with Nulls, then search all ProcessData records for KPA.G and replace with Nulls until all occurrences of aliases listed in tblAlias have been replaced by nulls in tblProcessData. Giving me the result below:
Desired Result
TblData
TagNo ProcessData
1PT5 100Kpa
2PCV04 10
1JB12 Yellow
1PT07 7
5PG03 12
I have searched the forums for an answer for over 2 hours for a similar problem to no avail. Any help would be greatly appreciated. I am definitely not a VBA guru but know my way around access pretty well.