Hi Julien,
I think you need to rethink the design/structure. I opened the second form (selectionCheques) but it is not updatable for me, probably because you use lookup fields (member ID in membre) and use that in an equijoin query as the source of the form. Most Access developers avoid using lookup fields (and captions) in tables as they mostly cause problems and mask the root causes of problems. You only need the lookups in the forms and reports as an easy way to display the related info. I would try to avoid the filter you use and replace the recordsource for selectionCheques with an updatable select query taking the individual filter components as parameters.
I would also pay attention to what is happening to the main form before you open the second one:
Code:
Private Sub Command478_Click()
If IsNull([id]) Then
'MsgBox "new"
Dim strSQL As String, rs As DAO.Recordset
strSQL = "SELECT * FROM coordonneesEmergo"
Set rs = CurrentDb.OpenRecordset(strSQL)
folio = rs!noCompte
nomCompte = rs!nomCompte
noSuccursale = rs!noSuccursale
DoCmd.RefreshRecord
End If
If Not securiser Then
DoCmd.OpenForm "selectionCheques", , , "(type='Chèque' OR type = 'Mandat poste') AND encaisse =false AND dateCheque <=# " & dateDepot & "#"
Else
MsgBox "Ce bordereau de dépôt a déjà été imprimé. Pour l'imprimer à nouveau, veuillez le dé-sécuriser en cliquant sur le cadenas"
End If
End Sub
Why use recordsets to poppulate the three fields for the new (empty) record when you could use the default value of the controls?
Just some observations for now, looks like you put a lot of time in this so can't really offer much more but maybe they can push you in the right direction. I will include my updated front-end where I made some changes to the closing code of selectionCheques.
Cheers,
Vlad