A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#error in calculated textbox that references subform



 
 
Thread Tools Display Modes
  #1  
Old July 25th, 2008, 05:11 AM posted to microsoft.public.access.forms
Very Rusty User
external usenet poster
 
Posts: 1
Default #error in calculated textbox that references subform

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!!


  #2  
Old July 25th, 2008, 05:46 AM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default #error in calculated textbox that references subform

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
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Very Rusty User" Very Rusty wrote in
message
...
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.


  #3  
Old July 25th, 2008, 07:20 AM posted to microsoft.public.access.forms
Very Rusty User[_2_]
external usenet poster
 
Posts: 6
Default #error in calculated textbox that references subform

It worked! Thank you SO VERY much! I really appreciate your help.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.