Replace statement?

  • Thread starter Thread starter TA
  • Start date Start date
T

TA

Hello all,
I have a table with a field name "postyr". I want to
replace some of the value in the table.
How can I using replace statement in VB like this:
replace postyr = "2" with postyr = "2002"
replace postyr = "3" with postyr = "2003"
I tried using this but it replace all the value
with "2003":
With rs!postyr = "2"
rs!postyr = "2002"
End with
With rs!postyr = "3"
rs!postyr = "2003"
End With
Thank inadvance!
TA
 
It'd be duck soup with an update query... use "2" as the criteria and "2002"
as the Update To, or, if it is consistent, say <3 as the criteria, and
postyr +2000 as the Update To.

Sounds as if you're just converting to 4-digit years... if so, you can do
something similar with years before 2000, as well...

Larry Linson
Microsoft Access MVP
 
Back
Top