count null record in filed with DAO

  • Thread starter Thread starter sal21
  • Start date Start date
S

sal21

with this connection how to count record null or with len=0 in filed
APPELLATIVI and store the eresult in a var
Query, please...

Set DB1 = DBEngine.OpenDatabase("D:\PUBBLICA\APPLICAZIONI
\ANAGRAFICA_OK_10092007.mdb")
Set RSD1 = DB1.OpenRecordset("ANAGRAFICA1")
 
Hi

Something like...

Set DB1 = DBEngine.OpenDatabase("D:\PUBBLICA\APPLICAZIONI
\ANAGRAFICA_OK_10092007.mdb")
Set RSD1 = DB1.OpenRecordset("ANAGRAFICA1")

with RSD1
if .bof and .eof then
msgbox "no records"
exit sub
end if

.movefirst
mycount=0

do
if Nz(.fields!APPELLATIVI,"") = "" then
mycount = mycount + 1
end if
.movenext
loop until eof
end with

hth

Andy Hull
 
Back
Top