UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Calculated Controls Not Calculating On Forms, Access 2016    
 
   
EvilBert
post Sep 11 2019, 06:10 PM
Post#1



Posts: 148
Joined: 23-October 13
From: Brisbane


Hi All,

I've been off the scene for a while, but back on the horse!

I have a small issue that has popped up from one of my clients, and having trouble finding useful info on this.

On my client's machine the form (see attachments) doesn't calculate a control with the formula "Nz(Sum([SubsTotal]),0). It doesn't happen on every record he creates, so it seems to be a 'now and again' issue.

Recreating the same record on my copy here the control calculates fine.

The only difference between the two is that the client version is compiled, where as mine is not.

I've also attached a design view copy of the relevant control and formula.

I was hoping that someone may have an idea why this happens from time to time.

Kind regards,
Michael.


Attached File(s)
Attached File  ClientsMachine.jpg ( 877.06K )Number of downloads: 13
Attached File  MyMachine.JPG ( 321.5K )Number of downloads: 11
Attached File  DesignView.JPG ( 369.75K )Number of downloads: 13
 

--------------------

Kind regards,
Michael.
Go to the top of the page
 
RJD
post Sep 11 2019, 08:50 PM
Post#2


UtterAccess VIP
Posts: 10,022
Joined: 25-October 10
From: Gulf South USA


Hi Michael: I don't know if this will make a difference, but you might try rewriting the Sum to ...

=Sum(NZ([SubsTotal],0))

... making the NZ apply directly to [SubsTotal] rather than to the Sum result.

Might be worth a try.

It's often very hard to replicate this type of issue between different computers perhaps on different networks, especially since we do not have the db to test.

Just a thought ...

HTH
Joe


--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
EvilBert
post Sep 12 2019, 03:49 AM
Post#3



Posts: 148
Joined: 23-October 13
From: Brisbane


Hi Joe,

Thanks for the suggestion, I'll try it out.

It's a strange one, as it only happens once in a while, and I myself can't replicate it at my end either.

Kind Regards,
Michael.

--------------------

Kind regards,
Michael.
Go to the top of the page
 
missinglinq
post Sep 12 2019, 05:09 AM
Post#4



Posts: 4,634
Joined: 11-November 02



Does "Recreating the same record on my copy here the control calculates fine" mean recreated with the same exact data?

Is SubsTotal itself a calculated field?

Linq ;0)>
This post has been edited by missinglinq: Sep 12 2019, 05:10 AM

--------------------
Hope this helps!

The problem with making anything foolproof...is that fools are so darn ingenious!

All posts/responses based on Access 2003/2007
Go to the top of the page
 
Hugoj
post Sep 12 2019, 06:35 AM
Post#5



Posts: 30
Joined: 22-August 10



You could try Requery the form in an event. Maybe that will help.
Go to the top of the page
 
DanielPineault
post Sep 12 2019, 06:59 AM
Post#6


UtterAccess VIP
Posts: 6,848
Joined: 30-June 11



There was an issue many moons ago, Access 2010 I believe, that exhibited the same behavior. I ended up creating code to make the focus go around all the controls, which made the calculations appear. May be worth a try here as well, but would first try adding a control requery.

--------------------
Daniel Pineault (2010-2019 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
GroverParkGeorge
post Sep 12 2019, 08:22 AM
Post#7


UA Admin
Posts: 35,681
Joined: 20-June 02
From: Newcastle, WA


I was going to suggest the same thing Daniel did. While requerying controls seems like a bit of a PITA, it may be that the random appearance of the problem could reflect a timing issue which a manual requery (well, in VBA) could address.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
EvilBert
post Sep 12 2019, 06:01 PM
Post#8



Posts: 148
Joined: 23-October 13
From: Brisbane


I'll see how the client gets on. It's such a rare issue from my experience.

If it becomes more frequent I might add some requery commands in VBA to see if that helps.

Thanks again folks!

EDIT: Ah, forgot, yes the SubsTotal is a calculated field.
This post has been edited by EvilBert: Sep 12 2019, 06:02 PM

--------------------

Kind regards,
Michael.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    20th September 2019 - 07:10 AM