Hi all,
I have a form with multiple Textboxes. One of the textbox "arrays" (as I call them), has a control source as below:
=Val([Forms]![Frm_TyreForecast]![Frm_TyreForecastSubForm].[Form]![MM0_1])
In the form's Load Event, I do some calculations, but I receive the error "2447 - There is an invalid use of the . (dot) or ! operator or invalid parentheses"
Below the code
The line where the error occurs, is marked "===>" (Val(Me("QtyNeed" & i)))Code:For i = 1 To 22 ===> If Val(Me("QtyNeed" & i)) - Val(Me("SOH" & i)) < 0 Then Me("QtyPO" & i) = "0" Else Me("QtyPO" & i) = (Val(Me("QtyNeed" & i)) - Val(Me("SOH" & i))) End If Next i
The second part of the If statement (Val(Me("SOH" & i)) ) is fine and has the correct value.
If I put a physical number (ex. 2) into the control source of "QtyNeeded1", the calculations work fine, but of course the answers are wrong.
Much appreciated.