0

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

2
Contributors
12
Replies
27
Views
1 Year
Discussion Span
Last Post by rproffitt
0

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

0

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.

0

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

0

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.

0
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

0

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.

0

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

0

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.

0

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

0

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?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.