VBA/ Replacing data in a table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • garfieldsevilla
    New Member
    • Feb 2010
    • 37

    VBA/ Replacing data in a table

    I have a fairly long table with several fields and need to replace specific values in a field in a subroutine. I’m using a simple SQL statement at present:

    Code:
    DoCmd.RunSQL ("UPDATE table SET field = replace(field, '" & fromtxt & "', '" & totxt & "')")
    This results in a warning message saying you are about to update 9600 rows. Can someone show me how to stop this message? It’s confusing for the user as the update is initiated by the system.

    Also, is there a better way to do this in Access 2003? I’m updating less than 5 records each time.

    Many thanks
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1290

    #2
    Before the RunSQL command you need to put

    DoCmd.SetWarnin gs false

    and after the command you put

    DoCmd.SetWarnin gs true

    Jim

    Comment

    • garfieldsevilla
      New Member
      • Feb 2010
      • 37

      #3
      Many thanks Jim

      Comment

      Working...