Thread Title: "Invalid Use of Property" I'm having difficulty with a very small routine and am listing code below: Code: Dim OBplus As Double Dim sOBplus As String Dim OBNonPlus As Double Dim sOBNonPlus As String ' Accumulates to Variables OBPlus & OBNeg rsGlact.MoveFirst Do While rsGlact.EOF = False gAcno = rsGlact.Fields("Acno") If rsGlact.Fields("Rptype") = "P" Then If rsGlact.Fields("Oldbal") > 0 Then OBplus = (OBplus + rsGlact.Fields("Oldbal")) Else OBNeg = (OBNeg + rsGlact.Fields("Oldbal")) End If End If rsGlact.MoveNext Loop ' Determines Difference and stores Round() txtOBPlus = OBplus txtOBNeg = OBNeg txtDiffOld = (OBplus + OBNeg) txtDiffOld = Round(txtDiffOld, 2) Dim OBplus As Double Dim sOBplus As String Dim OBNeg As Double Dim sOBNeg As String rsGlact.MoveFirst Do While rsGlact.EOF = False gAcno = rsGlact.Fields("Acno") If rsGlact.Fields("Rptype") = "P" Then If rsGlact.Fields("Oldbal") > 0 Then OBplus = (OBplus + rsGlact.Fields("Oldbal")) Else OBNonPlus = (OBNonPlus + rsGlact.Fields("Oldbal")) End If End If rsGlact.MoveNext Loop ' Determines Difference and stores Round() txtOBPlus = OBplus txtOBNonPlus = OBNonPlus txtDiffOld = (OBplus + OBNonPlus) txtDiffOld = Round(txtDiffOld, 2) sOBplus = OBplus sOBNeg = OBNeg txtOBPlus = sOBplus txtOBNeg = sOBNeg It's at this point that my problem occurs. When attempting to enter to frmUtility, I receive the following error: "Invald use of Property" I will greatly appreciate help. Don Gaither
This is a correction of an earlier Post: I'm having difficulty with a small routine, the code for which I'm listing below: Code: Dim OBplus As Double Dim sOBplus As String Dim OBNonPlus As Double Dim sOBNonPlus As String rsGlact.MoveFirst Do While rsGlact.EOF = False gAcno = rsGlact.Fields("Acno") If rsGlact.Fields("Rptype") = "P" Then If rsGlact.Fields("Oldbal") > 0 Then OBplus = (OBplus + rsGlact.Fields("Oldbal")) Else OBNonPlus = (OBNonPlus + rsGlact.Fields("Oldbal")) End If End If rsGlact.MoveNext Loop ' Determines Difference and stores Round() txtOBPlus = OBplus txtOBNonPlus = OBNonPlus txtDiffOld = (OBplus + OBNonPlus) txtDiffOld = Round(txtDiffOld, 2) sOBplus = OBplus sOBNeg = OBNeg txtOBPlus = sOBplus txtOBNonPlus = sOBNeg Its at this point that the error ("Invalid use of Preperty") occurs. I have written numerous similar routines with no problem. I will greatly appreciate help in solving this problem. DONARCO
You have undeclared variables that your trying to assign values to. Check the last chunk of code so see where you dimensioned those variables. Code: sOBNeg = OBNeg txtOBPlus = sOBplus txtOBNonPlus = sOBNeg Your trying to use the MoveFirst property when I don't see where you gave reGlact an instance of a class. Do you use visual studio or visual basic express?
To Those Respondants: I have used excerpts from multiple responses and my routine is now working just fine. Thanks very much for your time and trouble. donarco (Don Gaither)