[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1686
  • Last Modified:

Access - Sum an unbound textbox keeps giving #Error.

Hi all

I have read several issues on this same question and all look like what I am getting.

Tried applying the solutions but still get the #error... FRUSTRATING>>>>>>>>>

Created a BLANK form (Continuous Form)
on that blank form in Tabbed view within the Detail section I have 6 unbound textboxes for input of values.

Those boxes are named
txtDaysMo1
txtDaysMo2
txtDaysMo3
txtDaysMo4
txtDaysMo5
txtDaysMo6

All are formatted General Number 0 Decimal Places

In the Form Footer section I have another unboud textbox and a copy/paste of the Control Source of that box is:
=Sum([txtDaysMo1])

I have also tried
=Sum(nz([txtDaysMo1],0))

I keep getting #Error

Any thoughts on where to look?
0
wlwebb
Asked:
wlwebb
  • 7
  • 6
1 Solution
 
mbizupCommented:
For The SUM function you need to use the name of the underlying field, not the name of the text box.
0
 
IrogSintaCommented:
I'm a bit confused.  If these textboxes are unbound, what are you summing?
0
 
mbizupCommented:
So maybe

= sum(DaysMo1)

In other words use the name of the field as it is seen in the record source table or query that your form is based on.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
wlwebbAuthor Commented:
I think I did.....  Here's a stripped version that is only that stupid form....or the stupid person's attempt at creating that form.........;-)
Sum-Unbound-Textbox.accdb
0
 
mbizupCommented:
Your attachment didn't make it into your post...

Edit:   Never mind  I think you were still editing your post.
0
 
wlwebbAuthor Commented:
mbizup.... yep... I tried opening myself to see if it worked.... using firefox and it opens as garbage......  Does it open for you???????????
0
 
wlwebbAuthor Commented:
IrogSinta
Trying to create an input form that doesn't update the table until a control button is clicked....  Only way I know how to do that is use unbound boxes and then in code have it update the table fields that will be on the form but hidden.....
0
 
mbizupCommented:
Like Ron, Im not quite sure what you are trying to do.

Aggegate functions like SUM need to be based on *fields*, not controls like your textboxes -- so summing your unbound textboxes simply isnt going to work.

What exactly (which values) are you trying to add up?
0
 
mbizupCommented:
As an example of how a SUM *does* work...

Suppose one of your textboxes (txtDaysMo1) is bound to a field (for example purposes, let's call that field F1)

Your SUM in the footer would look like this:

= SUM (F1)

(but not SUM(txtDaysMo1)  )
0
 
wlwebbAuthor Commented:
mbizup.....I know I've done that with bound but...and maybe there's a better way.... I am attempting to have an input field where the clerk's inputs don't create records or get into the table until they click a Save Control button.  .... Is there a way to do that using bound fields.... as I understand it, when they start inputting into the first box it will "create" a new record at that moment.... I'm trying to not create that record until they're done inputting everything.....


That said....  In the Property Sheet of that Text Box the Name field is txtDaysMo1 (copy/pasted)

I even created the formula for the Text Box in the footer from the Expression Builder and that expression is
=Sum([txtDaysMo1])
also copy/pasted
0
 
mbizupCommented:
Right ... the Name property won't work, you would need the ControlSource property of a bound control ... which is why SUM will not work for you.

Try using DSUM instead.

= DSUM("Yourfield", "yourtable")

DSUM
0
 
mbizupCommented:
I've got an extraneous DSum at the end there.   Blame my cellphone...
0
 
wlwebbAuthor Commented:
OK.............
I just played with a Single Form of what I am ultimately trying......I now see what you guys are trying to say in the Continuous Form.....

I have to create a Form for input of Patient Days by Month for each 6 Month Period....
For example, the clerk has to input Patient Days for:

Payor Source - Mo1, Mo2, Mo3, Mo4, Mo5, Mo6

They will input this for each Payor Source Type of
Private
Medicare
Medicaid
VA
Private Insurance
Etc....

My Table , [PatientDays] is setup as:
PatientDaysID
MonthEnding
PayorType
PatientDays

My PayorTypes are setup in a table called PayorType.... Thus for each PayorType that has the PayorType Field PatientDaysPayorType (a Yes/No Field) set to Yes then I'm going to have my form Create an Input set for that Payor Source
0
 
wlwebbAuthor Commented:
Not what I wanted as an answer.....but it's an access thing.....  Thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now