#error in calculated textbox that references subform

V

Very Rusty User

Hi. In Access 2007 I have an unbound textbox (called txtTotal) on the main
form that calculates a value. The ControlSource of txtTotal is an expression
that subtracts a field on the subform from a field on the main form. When
the subform has no records then the txtTotal says #error. It looks bad and
also causes an error of "expression has no value" in my code.

Help? Thanks!!
 
A

Allen Browne

See:
Avoid #Error in form/report with no records
at:
http://allenbrowne.com/RecordCountError.html

The article explains how the expression we commonly used in previous
versions fails in A2007, and suggests using a VBA function to return the
value as the expression works there.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 

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