Hi, What is a type of a Dataenvironment.rsMyRecordset if I want to pass it to a sub routine? 'Can it be a recordset? I tried different type, but didn't got the right one... private sub mySub(rsDEObj as ADODB.RecordSet) '... end sub Thanks you Marty
Hi, What is a type of a Dataenvironment.rsMyRecordset if I want to pass it to a sub routine? 'Can it be a recordset? I tried different type, but didn't got the right one... private sub mySub(rsDEObj as ADODB.RecordSet) '... end sub Thanks you Marty
Debug.Print TypeName(Dataenvironment.rsMyRecordset)
Thank you Jeff, Now I get this: > Debug.Print TypeName(Dataenvironment.rsMyRecordset) That give me "Recordset" 'The sub that receive the Dataenvironment.rsMyRecordset. Private Sub mySub(rsRecordset As Recordset) '... End Sub in my code I call: mySub(Dataenvironment.rsMyRecordset) Then I get a "Type mismatch" error. Is it really a "Recordset" type? Thanks you Marty
Lose the parentheses: mySub Dataenvironment.rsMyRecordset
That works very well, thanks Jeff. Marty
You can also just pass the DataEnvironment. Private Sub mySub( refDE As DataEnvironment ) refDE.rsSomeDefinedCommandReturningARS ... End Sub .... mySub DataEnvironment1 -ralph
1.Passing a Dataenvironment.rsMyRecordset to a sub routine.
Hi, What is a type of a Dataenvironment.rsMyRecordset if I want to pass it to a sub routine? 'Can it be a recordset? I tried different type, but didn't got the right one... private sub mySub(rsDEObj as ADODB.RecordSet) '... end sub Thanks you Marty
2.Passing parameter to DataEnvironment
Hi, Is it possible to pass parameter to a dataenvironment? I want it to execute a SQL query, but the query is builded using the SQL builder in the dataenvironment. I want that rsMyRecordset being made on different table that I specify. DataEnvironment1.rsMyRecordset.RecordCount Something like a "SELECT * FROM " & strMyTable executed in the DataEnvironment1.rsMyRecordset Can this be done? Thanks you very much Marty
Users browsing this forum: No registered users and 86 guest