i am using vb6
i am using sum fuction and bounding a textbox debittxt to it with the followin code
this code works fine, the problem arises only when there is no data in the table , my textbox (debittxt) shows null value obvious if there is no dataits sum is zero but why it donot show me zero(0) in the debittxt text field
i want the query to show 0 instead of blank if the sum is zero .
well i had try to make this coding that if the field is blank it is converted to zero
but getting error field not updateable ,
so what is the best solution for it.
i am using sum fuction and bounding a textbox debittxt to it with the followin code
Code:
dim debitrs as recordset set debitrs=new recordset debitrs.Open "select sum(debit) as debit from salestax", con, adOpenDynamic, adLockOptimistic Set totaldebittxt.DataSource = debitrs totaldebittxt.DataField = "debit"
i want the query to show 0 instead of blank if the sum is zero .
well i had try to make this coding that if the field is blank it is converted to zero
Code:
If totaldebittxt.Text = "" Then totaldebittxt.Text = 0 End If
so what is the best solution for it.
Comment