subform control not available after requery

H

Herb

My form uses a control based on a subform total to display current total of
open detail within periods. When the user selects my command to Post, VBA
closes the detail records, and requerys the related controls. In the case
where there are no longer any open details for a period, the subform total
should of course show zero. However, it shows "#NAME" on the form I'm
getting an error in VBA saying it can't find the control. How do I detect
this "zero" condition? Thanks.
 
B

boblarson

I'm assuming that you are using a controlsource of something with a
calculation or formula in it. If so, you can just use an IIF statement to
cover when something it needs is null. For example:

=IIF(IsNull([YourField1NameHere]),0,[YourFieldName2]/[YourFieldName1])


--
Bob Larson

Free Tutorials and Samples at http://www.btabdevelopment.com

__________________________________
 

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