Hi
I had a big procedure and I wanted to split it out in smaller parts.
But - bad luck - I saw that if I declare the recordsets in the first sub and after I try to use them(like rc.movefirst etc) in a called sub, it ain't work.
like this:
Sub example()
Dim db as dao.database
Dim rc as dao.recordset
Set db = currentdb
Set rc = currentdb.openrecordset("mytable", dbopendynaset)
dosomething
End Sub
sub dosomething()
rc.movefirst
msgbox rc(0)
end sub
well, as you know already probably, dosomething is not doing anything. Where am I wrong?
Thanks
I had a big procedure and I wanted to split it out in smaller parts.
But - bad luck - I saw that if I declare the recordsets in the first sub and after I try to use them(like rc.movefirst etc) in a called sub, it ain't work.
like this:
Sub example()
Dim db as dao.database
Dim rc as dao.recordset
Set db = currentdb
Set rc = currentdb.openrecordset("mytable", dbopendynaset)
dosomething
End Sub
sub dosomething()
rc.movefirst
msgbox rc(0)
end sub
well, as you know already probably, dosomething is not doing anything. Where am I wrong?
Thanks