I wrote down a solution but I don't know if it's right way.
It's working, but when will there be many records ?
what do you think about this?
thank you very much
On Error GoTo ErrComando5_Click
Dim sqlList As String
Dim strID, stMin, stMax As String
Dim ii
stMin = (DMin("[IDGroups]", "tblAutorisation", "[IDAccount]=Forms![frmAbbinamenti]![cboAccount]"))
stMax = DMax("[IDGroups]", "tblAutorisation", "[IDAccount]=Forms![frmAbbinamenti]![cboAccount]")
For ii = stMin To stMax
strID = DLookup("[IDGroups]", "tblAutorisation", "[IDAccount]=Forms![frmAbbinamenti]![cboAccount] And [IDGroups]=" & ii) & " And (ID)<>" & strID & "0"
Next ii
If IsNull(DMin("[IDGroups]", "tblAutorisation", "[IDAccount]=Forms![frmAbbinamenti]![cboAccount]")) Then
sqlList = "SELECT ID, Sigla, Description FROM tblGroups;"
Else
sqlList = "SELECT ID, Sigla, Description FROM tblGroups WHERE ((ID)<>" & strID & ");"
End If
Me.lstGroups.RowSource = sqlList
Me.Refresh