Problem : run-time error ‘-247352567 (80020009)’: You can’t assign a value to this object

Problem : run-time error ‘-247352567 (80020009)’: You can’t assign a value to this object

When I open a form and use this code it works fine when there are no values asigned to the field on the form and I can then add the values to the form. However when I open the form and Me.txtRiskRating has a value assigned I get the error above.

So far I have ensured that the field properties in the table are set to Number for each of the fields involved.

Any ideas would why this is hapening would be appreciated
Private Function TxtRiskCalculations()

If cboSeverity.Value = “1” And Me.cboProbability.Value = “1” Then
Me.txtRiskRating = “2”
Call TxtRiskOutcome1
ElseIf cboSeverity.Value = “1” And Me.cboProbability.Value = “2” Then
Me.txtRiskRating = “3”
Call TxtRiskOutcome1
ElseIf cboSeverity.Value = “1” And Me.cboProbability.Value = “3” Then
Me.txtRiskRating = “4”
Call TxtRiskOutcome1
ElseIf cboSeverity.Value = “1” And Me.cboProbability.Value = “4” Then
Me.txtRiskRating = “5”
Call TxtRiskOutcome2
ElseIf cboSeverity.Value = “1” And Me.cboProbability.Value = “5” Then
Me.txtRiskRating = “6”
Call TxtRiskOutcome2
ElseIf cboSeverity.Value = “2” And Me.cboProbability.Value = “1” Then
Me.txtRiskRating = “3”
Call TxtRiskOutcome1


 

Solution: run-time error ‘-247352567 (80020009)’: You can’t assign a value to this object

why do  you have to call a calculation in the activate event of the form?