Skip to content
Advertisement

Access VBA update a column to concatenate

I was trying to update a column from a table in my Access database with following VBA code but it did not work as nothing happpened to that column. I would like to concatenate 5 columns into one. This update statement would work in SQL server but obviously not here.

currentdb.Execute "update sys_AAAA_AAAA set ABI=AAT+AAU+AAV+AAW+AAX"

Any advice? Thanks.

Advertisement

Answer

Perhaps some fields are Null?

Try using the string “concatenator” preferred by Access, ampersand:

CurrentDb.Execute "update sys_AAAA_AAAA set ABI = AAT & AAU & AAV & AAW & AAX"
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement