If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: looping....

yoz ppl. here's the situation, i got 8 fields name Year1, Year2 ... and so forth until Year8. Now i need to check thru every1 of them 2 see if they are null. this is what i have in mind:

dim count as integer
dim store as string

count = 1

do until count = 9
if isnull(Year&count) then
store = Year&count
exit do
else
count = count + 1
end if
loop

the problem encountered here is that the Year and count concatenation does not work. so anyone got any idea how to concatenate the Year and count together so that it will come out as Year1, ...., Year8?

hey ppl, thx for the ideas. see that u all have been sort of arguing which is better. reason why i need to check for nulls using VBA is that it must be done in real time. and to me, using the query method seems to have the need to increase the number of forms. unless u guys have ideas on transfering the results of the query to the form without going thru another form and also cut down the ISNULL query to juz one query...

and Teddy, 8 different fields coz all the entries will have different values, so i can't create another table to link them. it will be a waste of db size and also have the same problem.