Your comboboxes are named cmbTurno and cmbTema but the code uses cboTurno and cboTema. (I prefer cbx prefix.) Fix names or fix code.
Select [Event Procedure] in the combobox AfterUpdate property.
The variables need to be string, not integer, type.
Public strTurno As String
Public strTema As String
Problem with this method is Format events only trigger for PrintPreview or direct to printer, not ReportView. Alternatively, the code will work in report Load event for any view.
An alternative to any event code is a function called by a textbox (textbox acts as 'label').
Code:
Private Function SetLabel() As String
SetLabel = "Fanculo"
If Nz(strTema, "") <> "" And Nz(strTurno, "") <> "" Then
'Sono stati selezionati sia un turno che un tema
SetLabel = "Tema " & strTema & "; Turno " & strTurno & ""
ElseIf Nz(strTema, "") <> "" Then
'Un tema è stato selezionato
SetLabel = "Tema " & strTema & ""
ElseIf Nz(strTurno, "") <> "" Then
'Un turno è stato selezionato
SetLabel = "Turno " & strTurno & ""
Else
'Nessuna selezione: sono stati selezionati tutti i record
SetLabel = "Tutti gli studenti"
End If
End Function
Textbox ControlSource: =SetLabel()
Also, variables lose their values when code execution is interrupted. Can be frustrating when debugging and code is dependent on global or public variables. Could make the variables local in the report code and set them by reference to the form controls.
Or use TempVars which don't lose value (I've never used them).