Your database variable is db.
You are executing sql against dbs. dbs does not exist.
Option Explicit tells you when variables are not declared.
To turn it on simply put Option Explicit at the top of each module.