G
Guest
Hi,
I have a large sub that I need to break down, so I am trying to pass an open
record to a function and get the record back... with the contents altered by
the funtion. I am getting a Invalid Use of Property error. Is it possible
to do what I am trying??? Here is a stripped down code snipit of the Sub and
Function. Thx - Mike
' code snipit
Public Sub MainRoutine
Dim cn As ADODB.Connection, rcdPPrice As New ADODB.Recordset
rcdPPrice.Open strSQL, cn, adOpenStatic, adLockReadOnly
rcdPPrice.MoveFirst
Do Until rcdPPrice.EOF
rcdPPrice = CallMyFunction( rcdPPrice )
rcdPPrice.MoveNext
Loop
End Sub
Public Function CallMyFunction( rcdPPrice As AODB.Recordset) As
ADODB.Recordset
' do some logic
CallMyFunction = rcdPPrice
End Function
I have a large sub that I need to break down, so I am trying to pass an open
record to a function and get the record back... with the contents altered by
the funtion. I am getting a Invalid Use of Property error. Is it possible
to do what I am trying??? Here is a stripped down code snipit of the Sub and
Function. Thx - Mike
' code snipit
Public Sub MainRoutine
Dim cn As ADODB.Connection, rcdPPrice As New ADODB.Recordset
rcdPPrice.Open strSQL, cn, adOpenStatic, adLockReadOnly
rcdPPrice.MoveFirst
Do Until rcdPPrice.EOF
rcdPPrice = CallMyFunction( rcdPPrice )
rcdPPrice.MoveNext
Loop
End Sub
Public Function CallMyFunction( rcdPPrice As AODB.Recordset) As
ADODB.Recordset
' do some logic
CallMyFunction = rcdPPrice
End Function