hi i have report in visaul basic 2015 in it the salary and i want to make a tetxbox and but the total in it i tried this Sum(Fields!salary.Value) but i get error

this is the data just open form1 and press print you will see, i am using visual basic 2015
Click Here
this the link of the data
i can't put it here

That was horrible. Sites pop up, I'd have to wait or pay. Source code, just the lines that error and the error can be pasted in the forum. Sometimes a member doesn't want to work at it.

if you want i can send the data to your mail
plz send it to me

Is it very difficult topic

Visual Basic 2015 is code. This forum supports code in replies. Copy and paste the line or lines you think are in error.

If you paste the entire app, then no one looks for many reasons.

Imports System.Data.OleDb
Public Class Form1
    Dim ds As DataSet
    Dim da As OleDbDataAdapter
    Dim tables As DataTableCollection
    Public Con As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source= invo.accdb;Jet OLEDB:Database Password=123456;")



    Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click
        'print the items balance
        Try
            'Dim NO As String = Val(txtBillNo.Text)
            Dim DA As New OleDbDataAdapter("SELECT itemname, Sum(quntity)  as quntity FROM temp_bal GROUP BY temp_bal.itemname;", Con)
            DA.Fill(Form4.DataSet2, "datatable1")
            Form4.Show()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class

1.jpg

I see no code to create the SUM that I guess is where the #Error is on that screen. I would be guessing this error is in your Access too. (Which is not Visual Basic.) Also I don't see Sum(Fields!salary.Value) in your code.

i give you an example (salary) but here as you see quntity
All I want is to know can we sum the columns in the report , such as ACCESS report
I am very sorry for your time

So line 14 is the issue?

I see a non-numeric at the top of the column. Where is that coming from? It could be why it can't sum the column.

i do not now why but the line 14 collect the in and out of the items and but it in this table by query as you see
anly i want sum the colomn
is there any way to sent you the data to see it

Research why there is a non-numeric in that column. I don't have Access on this machine so I can't run your system. Why not return your numbers into an array and see what's up?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.