Loop count

M

Michael Noblet

I have an IIf statement that looks for blank fields in a
database and fills it in. the Expressions is:

iif([admit date] is null, dlookup("[admit
date]", "tblDiagnosisUnder16Final","[id]=" &[id]-1),[admit
date])

I need to replace the -1 portion after [id] with a
function that counts the number of blank fields as that
number is variable.

therefore the end of the expression would be [id]-
BlankCount([admit date]) or something like that. I know
this needs to have a loop, but I am strugling with setting
up the function to use in the expression. any help would
be appreciated.

Mike
 
A

Alex Ivanov

Somethink like this? (air code)

Sub BlankCount(rs as recordset)
dim f as field
dim cnt as integer
cnt=0
for each f in rs.fields
if isnull(f.value) then cnt=cnt+1
next
blankcount=cnt
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top