Question : Access Multiples Updates

Good morning,

I need to do several updates in one query, but I'm not working, I'd like to know which is the separator to write more than one update per query?.

Ms Access: 2010

Syntax:
September rep_imsu_bases update BKR01B4 = 'SBK731B4' where name = 'DM5HIS';
September rep_imsu_bases update BKR01B4 = 'SBK931B4' where name = 'DM5INT';
September rep_imsu_bases update BKR01B4 = 'SBK741B4' where name = 'DM5PRD';
September rep_imsu_bases update BKR01B4 = 'SBK721B4' where name = 'DM5QAS';

Answer : Access Multiples Updates

Create a module with this function and run it.

Public Function UpdateMultiples()

    DoCmd.SetWarnings False
    DoCmd.RunSQL "UPDATE [September rep_imsu_bases] SET BKR01B4 = 'SBK731B4' where name = 'DM5HIS';"
    DoCmd.RunSQL "UPDATE [September rep_imsu_bases] SET BKR01B4 = 'SBK931B4' where name = 'DM5INT';"
    DoCmd.RunSQL "UPDATE [September rep_imsu_bases] SET BKR01B4 = 'SBK741B4' where name = 'DM5PRD';"
    DoCmd.RunSQL "UPDATE [September rep_imsu_bases] SET BKR01B4 = 'SBK721B4' where name = 'DM5QAS';"
    DoCmd.SetWarnings True

End Function
Random Solutions  
 
programming4us programming4us