Sum for text datatype for some values. (1 Viewer)

Falcon88

Registered User.
Local time
Today, 17:14
Joined
Nov 4, 2014
Messages
299
Hi all

I have a continuous subform contains
cboTestNo.
txtresult
Based on testsDetails tbl

The textbox txtresult is text datatype .

There is a condition
Where
If user select 4 and 5 and 9 together by cboTestNo, for same person (that is in the MainForm). The total of that values in the txtresult must be 100 , if not 100 alert user to check the numbers in that field to make them equals 100 .

Note : user may be insert values additionally to that person ( that is in the MainForm).by the cboTestNo, but the important here is the numbers 4,5 and 9, otherwise not.
An example:
cboTestNotxtResult
1dr56
267
443.56
522.7
978.2
And if user select 4, 5 only , alert user it is necessary to select 9 .
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 09:14
Joined
Feb 28, 2001
Messages
27,175
If the field in question is text that includes the possibility of digit strings that could be interpreted as text, there are ways to deal with that... but you have a problem. For test #1, you have a field in which your content is text followed by digits, so the "cheap" way to deal with this (the VAL function) won't work for you either.

And by the way, if we go by strict math, your 4, 5, & 9 solution doesn't work either because I count that total as 144.46 rounded to 2 places. If we take out the 4 as a choice, your total is 100.9 which is ALSO not 100.

Your problem statement is not clear and your example doesn't help, so I'm going to say we can't help you YET. We need a better explanation. Try to give us an overview of the problem in language. What are you trying to do? What are the business rules?
 

Falcon88

Registered User.
Local time
Today, 17:14
Joined
Nov 4, 2014
Messages
299
If the field in question is text that includes the possibility of digit strings that could be interpreted as text, there are ways to deal with that... but you have a problem. For test #1, you have a field in which your content is text followed by digits, so the "cheap" way to deal with this (the VAL function) won't work for you either.

And by the way, if we go by strict math, your 4, 5, & 9 solution doesn't work either because I count that total as 144.46 rounded to 2 places. If we take out the 4 as a choice, your total is 100.9 which is ALSO not 100.

Your problem statement is not clear and your example doesn't help, so I'm going to say we can't help you YET. We need a better explanation. Try to give us an overview of the problem in language. What are you trying to do? What are the business rules?
I put this as an example , i write values have total 144.46 ( where total <>100 ) , which suppose the program alert the user in such a case.
 

Users who are viewing this thread

Top Bottom