I'm just starting out in VB by taking an online course. The project I'm supposed to make will not run, and i cant figure out why. Here's what I have:
Private Sub cmdCalculate_Click() 'Declare variables Dim curPrice As Currency Dim curCost As Currency Dim curComm As Currency 'Set variable values to entered data curPrice = Val(txtPrice) curCost = Val(txtCost) 'Calculates and displays commission curComm = 0.2 * (curPrice - curCost) lblCommissiondisplay = FormatCurrency(curComm) lblNamedisplay = txtName End Sub
First error that comes up is "Arument not optional" with the txtboxes highlighted after the Val functions. Second, in the last two lines of code, it claims an "Invalid use of property" highlighting the two lbl boxes and the text box.
Not understanding this. Some of those exact lines of code are in my study guide. PLz Help