Hi
Can someone help what would be the best way to search multiple fields in a record and update only those whom value is equal to a varible string (stringX). There could be 60 fields in the record and only some of them will need updating. Looping through each record I can only think to do it this way:
Must be a better than than this?
Do Until rstDat.EOF
if rstDat.field1 = stringX then
rstDat.Edit
rstDat.field1 = NewStringX
rstDat.Update
end if
if rstDat.field2 = stringX then
rstDat.Edit
rstDat.field2 = NewStringX
rstDat.Update
end if
etc
etc
etc
rstDat.MoveNext
Loop
Can someone help what would be the best way to search multiple fields in a record and update only those whom value is equal to a varible string (stringX). There could be 60 fields in the record and only some of them will need updating. Looping through each record I can only think to do it this way:
Must be a better than than this?
Do Until rstDat.EOF
if rstDat.field1 = stringX then
rstDat.Edit
rstDat.field1 = NewStringX
rstDat.Update
end if
if rstDat.field2 = stringX then
rstDat.Edit
rstDat.field2 = NewStringX
rstDat.Update
end if
etc
etc
etc
rstDat.MoveNext
Loop