database - How to check/update a row of values based on a single column header?(Access) -
i have database many tables. in first table, have field called status
.
table 1 idno name status 111 hjghf yes 225 hjgjj no 345 hgj yes
other tables have same idno
different fields.
i want check status each id no , if yes id number in tables null , blank fields want update them 111111.
i looking sample vba code can adapt.
thanks
here largely untested code. give start.
sub updatenulls() dim strsql string dim rs dao.recordset each tdf in currentdb.tabledefs if left(tdf.name, 4) <> "msys" , tdf.name <> "table1" strsql = "select * [" & tdf.name & "] inner join " _ & "table1 on a.idno = table1.idno table1.status = 'yes'" set rs = currentdb.openrecordset(strsql) while not rs.eof = 0 rs.fields.count - 1 if isnull(rs.fields(i)) rs.edit rs.fields(i) = 111111 rs.update end if next rs.movenext loop end if next end sub
Comments
Post a Comment