D
DWTSG
Here is my code
Dim curAmt(1 To 7) As Currency
Dim txtAmt(1 To 7) As String
Dim intCtr As Integer
Dim curTotal As Currency
For intCtr = 1 To 7
curAmt(intCtr) = Val(txtAmt(intCtr).Value)
curTotal = curTotal + curAmt(intCtr)
Next intCtr
'curAmt(2) = Val(txtAmt2.Value)
'curTotal = curTotal + curAmt(2)
'curAmt(3) = Val(txtAmt3.Value)
'curTotal = curTotal + curAmt(3)
'curAmt(4) = Val(txtAmt4.Value)
'curTotal = curTotal + curAmt(4)
'curAmt(5) = Val(txtAmt5.Value)
'curTotal = curTotal + curAmt(5)
'curAmt(6) = Val(txtAmt6.Value)
'curTotal = curTotal + curAmt(6)
'curAmt(7) = Val(txtAmt7.Value)
'curTotal = curTotal + curAmt(7)
I have commented out the portion of code that the Array and Loop are
supposed to take the place of. txtAmt are text boxes on a user form. My
problem arises from this line curAmt(intCtr) = Val(txtAmt(intCtr).Value)
.. I get a invalid qualifier error. If I change the array data type in the
declaration. I get a debug error.
Any suggestions would be great. Thanks
Dim curAmt(1 To 7) As Currency
Dim txtAmt(1 To 7) As String
Dim intCtr As Integer
Dim curTotal As Currency
For intCtr = 1 To 7
curAmt(intCtr) = Val(txtAmt(intCtr).Value)
curTotal = curTotal + curAmt(intCtr)
Next intCtr
'curAmt(2) = Val(txtAmt2.Value)
'curTotal = curTotal + curAmt(2)
'curAmt(3) = Val(txtAmt3.Value)
'curTotal = curTotal + curAmt(3)
'curAmt(4) = Val(txtAmt4.Value)
'curTotal = curTotal + curAmt(4)
'curAmt(5) = Val(txtAmt5.Value)
'curTotal = curTotal + curAmt(5)
'curAmt(6) = Val(txtAmt6.Value)
'curTotal = curTotal + curAmt(6)
'curAmt(7) = Val(txtAmt7.Value)
'curTotal = curTotal + curAmt(7)
I have commented out the portion of code that the Array and Loop are
supposed to take the place of. txtAmt are text boxes on a user form. My
problem arises from this line curAmt(intCtr) = Val(txtAmt(intCtr).Value)
.. I get a invalid qualifier error. If I change the array data type in the
declaration. I get a debug error.
Any suggestions would be great. Thanks