get a value from as we loop through table

G

Guest

Hi! Please help me! i have a filed ADay on the table. when i loop through
rows using "aDate = rst![ADay]" everything goes fine until there is a null.
and when it has null my program stop. and when i use "aDate =
DLookup("[ADay]", "Table1")", it would work good even if i have null and it
would go through. but when it is looping it would have the first value that
it get all the way. and it is not suppose to. the values on records changes.
but i don't get it why it is keeping the old value all the time. is there any
other function i should use it. help me please!

aDate = DLookup("[ADay]", "Table - List Empl and Contr")
aDate = rst![ADay]
MsgBox (aDate)
 
S

SusanV

You could either filter out nulls using SQL in your data source, or try the
Nz function.
 
G

Guest

Thanks Susan, how do i use nz function nz((dlookup),0). would it bring the
values from the current row when i loop each time. because when i was using
it. it would have the first value always and i don't know why. help me with
that, too. thanks!

SusanV said:
You could either filter out nulls using SQL in your data source, or try the
Nz function.
--
hth,
SusanV

Thelee said:
Hi! Please help me! i have a filed ADay on the table. when i loop through
rows using "aDate = rst![ADay]" everything goes fine until there is a
null.
and when it has null my program stop. and when i use "aDate =
DLookup("[ADay]", "Table1")", it would work good even if i have null and
it
would go through. but when it is looping it would have the first value
that
it get all the way. and it is not suppose to. the values on records
changes.
but i don't get it why it is keeping the old value all the time. is there
any
other function i should use it. help me please!

aDate = DLookup("[ADay]", "Table - List Empl and Contr")
aDate = rst![ADay]
MsgBox (aDate)
 

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

Top