Why use VBA? This is a pretty simple query, which can run as a query and update or show or whatever.
You can create a new query from Query Design and instead of selecting tables and fields, switch to SQL view and put in
Update table_name
Set col_name = Right(col_name, Len(col_name) - 7)
Save it and you have an update query ready to delete the first 7 characters.
Please note that without criteria, every time this query runs will remove 7 characters from all records, so be carefull.
adam_k
Practically a Posting Shark
803 posts since Jun 2011
Reputation Points: 256
Solved Threads: 149
I would use something similar to :
update table_name set col2 = right(col1,len(col1)-7)
where col2 is null
Not only you don't need to set col2 = col1, but you don't have to update the whole table. If col2 doesn't get a value until this query runs, then there should be no problem.
Even if you don't want the where part, then you should be OK if you run this for all records in the table.
adam_k
Practically a Posting Shark
803 posts since Jun 2011
Reputation Points: 256
Solved Threads: 149