In my ms-access vba project I am using me.Recordset in a sub form to pass the current recordset to a function (where I read the fields).
This works the first time but after a certain point I get the error:
3021 - no current record ("Kein aktueller Datensatz")
This is strange because I can see the record, all the fields are accessable with the !-operator (like Me!EM_KEY_PE) and Me.Recordset.RecordCount is 1. me.Recordset.EOF is false.
Debug.Print Me.Recordset!EM_KEY_PE
also raises the same error while Me!EM_KEY_PE works.
The recordset gets invalid after doing things like making the parent form invisible and visible again, saving the dataset and setting a new position for the parent form.
So how to fix this?
Things I tried so far:
- Use me.recordsetClone instead of me.Recordset => no effect
- not calling the function => Debug.Print Me.Recordset!EM_KEY_PE still raises an error