Change a value in a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Can someone please provide the code to change the value in a table using the
following example (Table Name = Data)

Store SOH SOO
123 5 1
124 6 2
1025 6 3

If the store number is less than 1000 I need to add 1000 to it so I end up
with the following:

Store SOH SOO
1123 5 1
1124 6 2
1025 6 3

I would prefer to do this via code.
 
Dim strSQL as String
strSQL = "UPDATE [Data] SET Store = 1000+Store WHERE Store <1000"
Currentdb.Execute strSQL, dbFailOnError
 
Thanks very much Duane
--
Andrew


Duane Hookom said:
Dim strSQL as String
strSQL = "UPDATE [Data] SET Store = 1000+Store WHERE Store <1000"
Currentdb.Execute strSQL, dbFailOnError
--
Duane Hookom
MS Access MVP

Andrew said:
Hi,

Can someone please provide the code to change the value in a table using
the
following example (Table Name = Data)

Store SOH SOO
123 5 1
124 6 2
1025 6 3

If the store number is less than 1000 I need to add 1000 to it so I end up
with the following:

Store SOH SOO
1123 5 1
1124 6 2
1025 6 3

I would prefer to do this via code.
 
Back
Top