Tronsliver
Technical User
If I create the Function below in a module off of "Form" and call the "Function" mulitiple times, will it create muliple instances of the recordset or will the recordset be destroyed in memory when the code in the Function reaches rst.close after each iteration? Obviously, I'm concerned about memory usage. Thanks!
Public Function FindAuthStr(varx As Integer)
Dim rst As Recordset
Dim x As Double
Set rst = CurrentDb().OpenRecordset("qryAuthAssign", dbOpenDynaset)
With rst
.MoveFirst
Do Until .EOF
If !orgstrPrNbr = varx Then
x = x + !streintAuthStr
End If
.MoveNext
Loop
FindAuthStr = x
rst.Close
End With
End Function
Public Function FindAuthStr(varx As Integer)
Dim rst As Recordset
Dim x As Double
Set rst = CurrentDb().OpenRecordset("qryAuthAssign", dbOpenDynaset)
With rst
.MoveFirst
Do Until .EOF
If !orgstrPrNbr = varx Then
x = x + !streintAuthStr
End If
.MoveNext
Loop
FindAuthStr = x
rst.Close
End With
End Function