sulu
01-09-2008, 05:02 AM
Hi guys :-)
I started my HND in Computing last September, but due to serious illness, i had to take 2 months off.
I am now quite a way behind the rest of the class and the college is trying to force me to leave - this is not an option as I have a family to support and need to pass this course!!
Anyhow, I have been given my 1st VB assignment ( to design a basic VAT calculator) and the tutor is more than unhelpful due to the rest of the class being demanding at their perticular level.
I have successfully created a calculator (TBH it wasnt that hard to create!!) please see code:
Private Sub cmdcalculate_Click()
'The name of the program'
txtans.Text = Str(ans)
'The end result is equal to the calculation of part 1 x part 2'
If Lstvat.ListIndex = -1 Then Lstvat.ListIndex = 0
'This ensures the value of the list box is zero or higher'
If IsNumeric(Txtnumber1.Text) Then
txtans.Text = Str(Val(Txtnumber1.Text) * Lstvat.List(Lstvat.ListIndex) / 100)
'This is the main calculation - i.e. the value of amount input x the pre-set %'
Else
lblerrormessage.Caption = ("'Incorrect format'")
'Basic error message should the user decide to input letters rather than numbers'
End If
End Sub
Private Sub cmdclear_Click()
'Basic program to hide lable including msg for when error inputted'
lblerrormessage = ""
Txtnumber1.Text = ""
txtans.Text = ""
End Sub
Private Sub Form_Load()
End Sub
I am seriously struggling to write it up though!!
Does anybody here have a sample of a VB assignment (not bothered as to the subject matter as I am not intending to plagerise!!) I may borrow/read??
Many thanks
Jason
I started my HND in Computing last September, but due to serious illness, i had to take 2 months off.
I am now quite a way behind the rest of the class and the college is trying to force me to leave - this is not an option as I have a family to support and need to pass this course!!
Anyhow, I have been given my 1st VB assignment ( to design a basic VAT calculator) and the tutor is more than unhelpful due to the rest of the class being demanding at their perticular level.
I have successfully created a calculator (TBH it wasnt that hard to create!!) please see code:
Private Sub cmdcalculate_Click()
'The name of the program'
txtans.Text = Str(ans)
'The end result is equal to the calculation of part 1 x part 2'
If Lstvat.ListIndex = -1 Then Lstvat.ListIndex = 0
'This ensures the value of the list box is zero or higher'
If IsNumeric(Txtnumber1.Text) Then
txtans.Text = Str(Val(Txtnumber1.Text) * Lstvat.List(Lstvat.ListIndex) / 100)
'This is the main calculation - i.e. the value of amount input x the pre-set %'
Else
lblerrormessage.Caption = ("'Incorrect format'")
'Basic error message should the user decide to input letters rather than numbers'
End If
End Sub
Private Sub cmdclear_Click()
'Basic program to hide lable including msg for when error inputted'
lblerrormessage = ""
Txtnumber1.Text = ""
txtans.Text = ""
End Sub
Private Sub Form_Load()
End Sub
I am seriously struggling to write it up though!!
Does anybody here have a sample of a VB assignment (not bothered as to the subject matter as I am not intending to plagerise!!) I may borrow/read??
Many thanks
Jason