Trying to find a 0.00 in list of numbers currency

Local time
Today, 21:28
Joined
Sep 1, 2024
Messages
40
I want my textbox tbTotalAdditionalChargeAmount to show 0.00 if there is a total for that amount in tblAddition_ItMdt.AddictionChargeAmount

It will be a warning that field does not have a amount

strSQL = "SELECT SUM(AdditionChargeAmount) AS AdditionSum" & " FROM tblAddition_ItMdt WHERE HorseID=" & val(tbHorseID.value)

tbTotalAdditionalChargeAmount.value = Nz(recAddition.Fields("AdditionSum"), 0)

Thanks for any help.....................Bob
 
Not really clear of the relationship between the two tables - is one supposed to be a total of the other - and how does 0.00 act as a warning? What if there are no values in the table?

You might want to investigate using the format property for the control? For numbers there are 4 states - positive,negative,zero and null, separated be a ;

So for example you might set it to

;;;[red]0.00

Or perhaps
;;;[red]”value required”
 
So when my code sums up say HorseID 216 and if it has a 0.00 amongst its totals , I want there to be a warning on my form so show that
Thanks for your help
 

Attachments

  • Amount.jpg
    Amount.jpg
    86.1 KB · Views: 10
I don’t see any code that actually creates a recordset. I think you could use simple DSum() or DCount(). Warnings could be simple Conditional Formatting.
 
Maybe can I change this script to add only values less than 0.10
strSQL = "SELECT SUM(AdditionChargeAmount) AS AdditionSum" & " FROM tblAddition_ItMdt WHERE HorseID=" & val(tbHorseID.value)
Thanks for the help
 

Users who are viewing this thread

Back
Top Bottom