Calculating not working correct?

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
13 posts Page 2 of 2
Contributors
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Got it working Codenstuff
like i said starting over :D
now it works how it must be

thanks for you helping you are the BEST
:lover;
Code: Select all
While empls.Read() = True
                        Dim item As New BoxControlItem
                        amexpense = 0
                        amincome = 0
                        amrefund = 0
                        iSpent = 0

                        With item
                            .Controls.Clear()
                            .Name = empls.GetValue(4) 'id
                            .Tag = empls.GetValue(4).ToString
                            dates = empls.GetValue(0).ToString

                            .MyAmount = Format(empls.GetValue(2).ToString)
                            .Amount = FormatCurrency(.MyAmount, 2)
                            .MyBudget = Format(tmpbalance)

                            If Not empls.GetValue(1).ToString = String.Empty Then
                                .mPayer = empls.GetValue(1).ToString
                            End If
                            .mDescription = empls.GetValue(3).ToString 'tooltip

                            If Not empls.GetValue(6).ToString = String.Empty Then
                                .Vendor = empls.GetValue(6).ToString
                            End If

                            If empls.GetValue(7).ToString = "True" Then
                                .mEnabled = True
                            Else
                                .mEnabled = False
                            End If

                            Select Case empls.GetValue(5).ToString

                                Case "Income"
                                    If .mEnabled = True Then
                                        .mColor = Color.Lime
                                        amincome = .MyAmount
                                        iBalance = Format(.MyBudget + .MyAmount)
                                        .Balance = FormatCurrency(iBalance, 2)
                                    Else
                                        .mColor = Color.FromArgb(116, 116, 116)
                                    End If
                                Case "Refund"
                                    If .mEnabled = True Then
                                        .mColor = Color.SteelBlue
                                        amrefund = .MyAmount
                                        iBalance = Format(.MyBudget + amrefund)
                                        .Balance = FormatCurrency(iBalance, 2)
                                    Else
                                        .mColor = Color.FromArgb(116, 116, 116)
                                    End If
                                Case "Expense"
                                    If .mEnabled = True Then
                                        .mColor = Color.Crimson
                                        amexpense = .MyAmount
                                        iBalance = Format(.MyBudget - amexpense)
                                        .Balance = FormatCurrency(iBalance, 2)
                                    Else
                                        .mColor = Color.FromArgb(116, 116, 116)
                                    End If
                            End Select

                            .mAccount = empls.GetValue(8).ToString 'accounts

                            .Refresh()
                            .Dock = DockStyle.Top
                        End With

                        Me.Invoke(New UpdateProgessCallback(AddressOf Me.updateprogress), item)
                        iTotalExpAmt += amexpense

                        If iBalance < 0 Then
                            'Gone over budget
                            Me.txtBalance.ForeColor = Color.Crimson
                            iBalance = -iBalance

                        Else
                            Me.txtBalance.ForeColor = Color.SteelBlue
                        End If
                        Me.txtBalance.Text = FormatCurrency(iBalance, 2)

                        txtTotSpent.Text = FormatCurrency(iTotalExpAmt, 2)
                    End While
                    empls.Close()
                Else
                    ClearTotalsInfo()
                End If
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

If at first you don't succeed, give up and try something else. :teehe; lol

Glad you got it working, good job :)
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

Thanks Codenstuff :D
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
13 posts Page 2 of 2
Return to “Coding Help & Support”