HelloWorld
02-26-2012, 11:12 AM
I have 5 text boxes. There names are:
DiagnosisFee
XRayFee
LabTestFee
IndoorInjectionFee
Bedcharge
I needed to add the values in these text boxes by clicking on a button called Calculate and display it in a textbox called FTotalFees. This part works well. Here is my code:
Private Sub Calculate_Click()
Dim IntNum1 As Integer
Dim IntNum2 As Integer
Dim IntNum3 As Integer
Dim IntNum4 As Integer
Dim IntNum5 As Integer
Dim Total As Integer
IntNum1 = DiagnosisFee
IntNum2 = XRayFee
IntNum3 = LabTestFee
IntNum4 = IndoorInjectionFee
IntNum5 = Bedcharge
Total = IntNum1 + IntNum2 + IntNum3 + IntNum4 + IntNum5
FTotalFees = Total
End Sub
Now i need to convert the value displayed in the textbox called FTotalFees to words. for example 1000 = thousand or 100 = hundred. I know what the totals will because the user can select the numbers to add through a combo box. They cannot add any value they want.
So i made another textbox called WTotalFees and a button called ConvertWord. When i click on it i should be able to get the number in words. Here is my coding but i do not know if i have written it properly:
Private Sub ConvertWord_Click()
Dim Word As String
Dim Total As Integer
FTotalFees = Total
WTotalFees = Word
Select Case Word
Case Total = 5000
WTotalFees = "Five Thousand"
Case Total = 10000
WTotalFees = "Ten Thousand"
Case Total = 15000
WTotalFees = "Fifteen Thousand"
End Select
End Sub
Please try to elaborate your answer because i'm only a beginner.
Thanks a lot!!!
DiagnosisFee
XRayFee
LabTestFee
IndoorInjectionFee
Bedcharge
I needed to add the values in these text boxes by clicking on a button called Calculate and display it in a textbox called FTotalFees. This part works well. Here is my code:
Private Sub Calculate_Click()
Dim IntNum1 As Integer
Dim IntNum2 As Integer
Dim IntNum3 As Integer
Dim IntNum4 As Integer
Dim IntNum5 As Integer
Dim Total As Integer
IntNum1 = DiagnosisFee
IntNum2 = XRayFee
IntNum3 = LabTestFee
IntNum4 = IndoorInjectionFee
IntNum5 = Bedcharge
Total = IntNum1 + IntNum2 + IntNum3 + IntNum4 + IntNum5
FTotalFees = Total
End Sub
Now i need to convert the value displayed in the textbox called FTotalFees to words. for example 1000 = thousand or 100 = hundred. I know what the totals will because the user can select the numbers to add through a combo box. They cannot add any value they want.
So i made another textbox called WTotalFees and a button called ConvertWord. When i click on it i should be able to get the number in words. Here is my coding but i do not know if i have written it properly:
Private Sub ConvertWord_Click()
Dim Word As String
Dim Total As Integer
FTotalFees = Total
WTotalFees = Word
Select Case Word
Case Total = 5000
WTotalFees = "Five Thousand"
Case Total = 10000
WTotalFees = "Ten Thousand"
Case Total = 15000
WTotalFees = "Fifteen Thousand"
End Select
End Sub
Please try to elaborate your answer because i'm only a beginner.
Thanks a lot!!!