sql - Trying to use VBA to delete an entire row if one field in null/blank -


so working on project import excel file access, when importing( tables in excel have same tables headings in access) tend bunch of rows because in excel file have functions behind of cells, why, tho appears empty, access transfers rows tho nothing entered it.

so question is, there way using vba in access can automatically, once excel file imported, loop through rows in specific table , delete entire row based on specific criteria. if within row there empty field, delete whole entire row. save me lot of time, instead of manually searching through table blank fields , deleting row myself.

i have knowledge working vba im unsure of how go doing this, trying use delete sql statement, couldn't figure out how since need in vba.

  1. create sql query pulls rows want delete.
  2. once query finished liking, go sql view query, , remove before clause.
  3. instead, type delete there. save query. should "delete blah blah, blah, blah"

so have query delete rows want to. now, run through vba (note can run manually double-clicking in queries pane), put following line in want run.

docmd.openquery "yourdeletequeryname" 

note yourdeletequeryname should replaced delete query name.


Comments