Tricky Loop question.

StefanSch

Registered User.
Local time
Tomorrow, 00:03
Joined
Jan 18, 2003
Messages
136
I am trying the following:

I have a subform with maximum 10 records. If one or more of the records have a negative value, I would like to make a certain text box in another subform visible.

I guess that to achieve this, I will have to somehow loop through each record in the subform to check whether one or more values are negative.

I am lost. I just don't know how to do this.

Please help me. Thanks a lot.
 
Use a calculated control in the footer to determine how many records are below zero. Then reference this...

=Sum(Iif([MyField]>0,0,1))

You can then query the control to determine the visibility of the text box.
 
Thanks a lot for this idea. This might work.

Since I am quite new in MS Access & VBA, can you please give me a bit more details (maybe code examples) how I do that?

Thank you so much.
 
Hi

I understood now what you meant. The source data of the calculated control in the footer should be the formula below.

I did that. However, unfotunately, the text box brings up #Name?

Do you know what could be the problem?
 
Problem is solved. The "Name" occured because the field control which was referenced was a calculated control as well.

Thank very much for your help.
 

Users who are viewing this thread

Back
Top Bottom