| | |
Substraction code in MSFlex Grid
Thread Solved |
Hi,
Try This :
Change names of your controls, and Column accordingly..
REgards
Veena
Try This :
vb Syntax (Toggle Plain Text)
Dim i As Integer Dim TAmt As Currency TAmt = 0 For i = 1 To Grd.Rows-1 TAmt = TAmt + Val(Grd.TextMatrix(i, 8)) Next TAmt = TAmt +Val(txtBudget.Text) MsgBox "Total Amount Is : " & Format(TAmt, "0.00")
Change names of your controls, and Column accordingly..
REgards
Veena
Last edited by QVeen72; Jan 7th, 2009 at 11:39 pm.
•
•
Join Date: Aug 2008
Posts: 28
Reputation:
Solved Threads: 0
Thank you Comatose,
After i rename it to Grd, the error disappear..
But still, i can't figure out how can it works..
What if my plan being like this..
I have to put first, the value of budget in the txtBudget..
Then, the value in the txtBudget will be reduced by every value in the Grd 8th column..
Then, the balance will be appear in the txtBalance..
Could anybody from 3 of you, tell me the codes to make it work? Sorry if i'm like asking, but i am a beginner VB user..
After i rename it to Grd, the error disappear..
But still, i can't figure out how can it works..
What if my plan being like this..
I have to put first, the value of budget in the txtBudget..
Then, the value in the txtBudget will be reduced by every value in the Grd 8th column..
Then, the balance will be appear in the txtBalance..
Could anybody from 3 of you, tell me the codes to make it work? Sorry if i'm like asking, but i am a beginner VB user..
Hi,
Yes, Little bit tweaking of my code, will do the job:
You can Call this In LostFocus Of txtBudget..
Regards
Veena
Yes, Little bit tweaking of my code, will do the job:
vb Syntax (Toggle Plain Text)
Dim i As Integer Dim TAmt As Currency TAmt = 0 For i = 1 To Grd.Rows-1 TAmt = TAmt + Val(Grd.TextMatrix(i, 8)) Next TAmt = Val(txtBudget.Text) - TAmt txtBalance.Text = Format(Tamt,"0.00")
You can Call this In LostFocus Of txtBudget..
Regards
Veena
Last edited by QVeen72; Jan 9th, 2009 at 2:29 am.
•
•
Join Date: Aug 2008
Posts: 28
Reputation:
Solved Threads: 0
Sorry... But, it didn't work.. Maybe, because i don't know how and where to use it.. I copied and pasted the latest codes by Venna in the private Sub Grd_Click like below..
Did i use it incorrectly? Here i enclosed a small-sized of the related form, to show u what i'm doing..
P/S: Do i need to put codes also in the txtBudget and txtBalance? Sorry for the dumb question...
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Private Sub Grd_Click() Dim i As Integer Dim TAmt As Currency TAmt = 0 For i = 1 To Grd.Rows - 1 TAmt = TAmt + Val(Grd.TextMatrix(i, 8)) Next TAmt = Val(txtBudget.Text) - TAmt txtBalance.Text = Format(TAmt, "0.00") End Sub
P/S: Do i need to put codes also in the txtBudget and txtBalance? Sorry for the dumb question...
Last edited by Narue; Jan 10th, 2009 at 9:33 pm. Reason: added code tags
•
•
Join Date: Aug 2008
Posts: 28
Reputation:
Solved Threads: 0
Plz sumbody.... Plz tell me, how to use the codes Venna gave me.. I really don't have the idea where to put the codes.. FlexGrid is a new thing for me.. It looks come to the solved, but i can't make it.. Plz... I need to pass this project, in order to get my diploma...
I'm not an IT student, but doing the IT project..
I'm not an IT student, but doing the IT project.. •
•
Join Date: Aug 2008
Posts: 28
Reputation:
Solved Threads: 0
What if like this... I have to put the budget value first in the txtBudget, then I need to click the cmdCalculate to have the balance calculated being in the txtBalance.... I really need a detail explaination, which codes to put in the FlexGrid, which in the txt and cmd... Plz... I need your kind help... I'm not an IT student, and don't have a good teacher about it.. Only God who knows how to repay your help.. Plz..
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Page setup + Print titles
- Next Thread: Any One Help me about UPDATING file in the Text .
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






