Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Access

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 11-04-2008, 03:24 PM
Novice
 
Join Date: Nov 2008
Location: Sugar Land, Tx
Posts: 2
micfly is on a distinguished road
Default total in textbox

Trying to show the total of these textbox controls.

I tried this:

=[FinRes]+[Gap]+[Vsc1]+[Vsc2]+[OtherF&I]

in the control source of the textbox control but that only works if there are numbers in all the fields.

So I try this:

=IIf(IsNull([FinRes]+[Gap]+[Vsc1]+[Vsc2]+[OtherF&I]),0,([FinRes]+[Gap]+[Vsc1]+[Vsc2]+[OtherF&I]))

But same thing.
How do I get the total to work if some of the fields are empty?

Sorry, just learning Access, thanks for any help.
Reply With Quote
  #2  
Old 11-08-2008, 07:30 AM
RuralGuy's Avatar
RuralGuy RuralGuy is offline Windows 7 Access 2007 (version 12.0)
Super Moderator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 3,848
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Use the Nz() function.
=Nz([FinRes],0)+Nz([Gap],0)+Nz([Vsc1],0)+Nz([Vsc2],0)+Nz([OtherF&I],0)
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #3  
Old 11-09-2008, 04:42 AM
Novice
 
Join Date: Nov 2008
Location: Sugar Land, Tx
Posts: 2
micfly is on a distinguished road
Default

Thanks for answering; I was beginning to wonder if anyone was on here helping. I finally figured it out and that's exactly what I did. I can't believe something so simple is so hard in Access (compared to Excel - which is what I am used to). Thanks again.
Reply With Quote
  #4  
Old 11-09-2008, 08:24 AM
RuralGuy's Avatar
RuralGuy RuralGuy is offline Windows 7 Access 2007 (version 12.0)
Super Moderator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 3,848
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Excellent! You always learn more when you solve it yourself anyway.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keeping text in a report textbox Hawkx1 Reports 2 11-13-2008 01:11 PM
A code to change textbox property in a form? mujaqo Access 1 08-09-2008 11:09 PM
Textbox will not allow input cwf Forms 0 04-04-2008 02:08 PM
dynamic textbox vam Programming 1 06-04-2006 06:59 AM
Report will not print a bound textbox vvrt Reports 0 03-16-2006 11:16 AM


All times are GMT -8. The time now is 08:17 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.