DAO searching all fields in Record (1 Viewer)

asid

Registered User.
Local time
Today, 21:31
Joined
Jan 25, 2006
Messages
22
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
 

EMP

Registered User.
Local time
Today, 10:31
Joined
May 10, 2003
Messages
574
The easiest way would be to do it manually by opening the table and using the Replace function from the Edit menu.

^
 

asid

Registered User.
Local time
Today, 21:31
Joined
Jan 25, 2006
Messages
22
needs to be automated

The client will be updating the data regularly so it needs to be automated. :)
 

Users who are viewing this thread

Top Bottom