subform control not available after requery

  • Thread starter Thread starter Herb
  • Start date Start date
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.
 
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

__________________________________
 
Back
Top