K
knenok
Guest
I'm trying to create a sub procedure, followed by a function procedure, but keep getting the errors
I have the following:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
displayAmount()
End Sub
Sub displayAmount()
TextBox3.Text = (((("Amount due in " & TextBox2.Text) & " ") & (calcInv(CDbl(TextBox1.Text)) & (calcInv.ToString("C")))))
End Sub
Function calcInv(nUns As Double, iMnth As String) As Double
Dim amountdue As Double
If iMnth = "June" Or iMnth = "July" Then
If nUns > 100 Then
amountdue = (nUns * 3)
Else
amountdue = (nUns * 2)
End If
Else
amountdue = (nUns * 2.1)
End If
Return amountdue
End Function
End Class
The bold & underlined 'calcInv' is where the error lines are showing up. I'm not really sure what to do to fix it.
Continue reading...
- 'Argument not specified for parameter 'iMnth' of 'Public Function calcInv(nUns As Double, iMnth As String) As Double'
- 'Argument not specified for parameter 'nUns' of 'Public Function calcInv(nUns As Double, iMnth As String) As Double'
- 'Argument not specified for parameter 'iMnth' of 'Public Function calcInv(nUns As Double, iMnth As String) As Double'
I have the following:
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
displayAmount()
End Sub
Sub displayAmount()
TextBox3.Text = (((("Amount due in " & TextBox2.Text) & " ") & (calcInv(CDbl(TextBox1.Text)) & (calcInv.ToString("C")))))
End Sub
Function calcInv(nUns As Double, iMnth As String) As Double
Dim amountdue As Double
If iMnth = "June" Or iMnth = "July" Then
If nUns > 100 Then
amountdue = (nUns * 3)
Else
amountdue = (nUns * 2)
End If
Else
amountdue = (nUns * 2.1)
End If
Return amountdue
End Function
End Class
The bold & underlined 'calcInv' is where the error lines are showing up. I'm not really sure what to do to fix it.
Continue reading...