Ok, so I seem to always make stupid mistakes, and I imagine this not to be a different case. However posting speeds up the process of finding the misspell. So, at the cost of annoying you, I'll risk my hide. Hope you take pity in me and try to give me a hand 
I need to update/edit the current recordset. The code I wrote works the first time I set focus to the record, afterward it says "error 3021: no current recordset".
If I set focus on another record and then return to edit this record, it newly works.
What I'm trying to do:
I have a continuous subform with a list of materials. On the side of each there's a button that opens a popup window with all the materials. From this window I double click and update the record.
I'm doing it through a recordset because I absolutely need to add a foreign key to the record that otherwise I wouldn't be able to (with a variable).

I need to update/edit the current recordset. The code I wrote works the first time I set focus to the record, afterward it says "error 3021: no current recordset".
If I set focus on another record and then return to edit this record, it newly works.
What I'm trying to do:
I have a continuous subform with a list of materials. On the side of each there's a button that opens a popup window with all the materials. From this window I double click and update the record.
I'm doing it through a recordset because I absolutely need to add a foreign key to the record that otherwise I wouldn't be able to (with a variable).
Code:
Private Sub cmdInsert_Click()
Dim varIDArt As Single
Dim varIDDett As Single
Dim rst As Recordset
Set rst = Me.Recordset
If Me.Parent.lstArticles.ListIndex <> -1 Then
varIDArt = Me.Parent.lstArticles.Column(1)
varIDDett = Me.Parent.lstArticles.Column(0)
Else 'at the beginning there's no selection
varIDArt = Me.Parent.lstArticles.Column(1, 0)
varIDDett = Me.Parent.lstArticles.Column(0, 0)
End If
DoCmd.OpenForm "RisultsMaterials" 'from where I choose the Material
Do While CurrentProject.AllForms("RisultsMateriali").IsLoaded
DoEvents
Loop
If Me.NewRecord Then
rst.AddNew
rst!MaterialID = varIDMAT 'this variable gets its value in the popup window
rst!DettLavID = varIDDett
rst!ArticoloID = varIDArt
Else
rst.Edit '----> this is the line underlined that says "no current recordset"
rst!MaterialID = varIDMAT
End If
rst.Update
Me.Requery
End Sub