Delete all null rows - Access VBA -


basic question.

i need delete null/blank rows of table in database. trouble there no way know how many fields there are, or names of fields before delete. , need verify every field null/blank before deleting. not sure how query in access vba.

in examples find, have field name can test blanks.

thanks in advance.

change testtabke table name. if have autonumber field, must skipped. using dao. if want ado, convert following code.

function deleteemptyrows()     dim db dao.database     set db = currentdb     dim rs dao.recordset     set rs = db.openrecordset("testtable")     until rs.eof         inx = 0 rs.fields.count - 1             if isnull(rs.fields(inx).value) or len(trim(rs.fields(inx).value)) = 0                 else: exit             end if         next         if rs.fields.count = inx             rs.delete         end if         rs.movenext     loop  end function 

Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -