M
Mark
Hi all,
I am trying to update a database that a previous person
has set up and am running into a problem adding fields in
a form. On the form, I have ten text boxes that I would
like to add up and fill a Totals box. I have the
following code in the first text box:
Private Sub IQ1_Score_AfterUpdate()
On Error GoTo Err_IQ1_Score_AfterUpdate
If Me.IQ1_Score > 10 Or Me.IQ1_Score < 0 Then
MsgBox "Value should be between 1 and 10.",
vbExclamation, "Notice:"
Me.IQ1_Score.SetFocus
Else
'Recalculates all ten fields and updates the "Total"
'Me.Total_Case_Score = "(Me.IQ1_Score) +
(Me.IQ2a_Score) + (Me.IQ2b_Score) + (Me.IQ2c_Score) +
(Me.IQ3a_Score) + (Me.IQ3b_Score) + (Me.IQ3c_Score) +
(Me.IQ3d_Score) + (Me.IQ4_Score) + (Me.IQ5_Score)"
End If
Exit_IQ1_Score_AfterUpdate:
Exit Sub
Err_IQ1_Score_AfterUpdate:
MsgBox Err.Description
Resume Exit_IQ1_Score_AfterUpdate
End Sub
I have the following code in the other 9 text boxes:
Call IQ1_Score_AfterUpdate
My problem: when I run the form and go to enter a number
in a field I get a error message saying, "The value you
entered isn't valid for this field."
I am not sure where the problem is? The form's control
source is the underlying table... not sure where to start
looking to solve the problem.
Thanks!!!!!!!
I am trying to update a database that a previous person
has set up and am running into a problem adding fields in
a form. On the form, I have ten text boxes that I would
like to add up and fill a Totals box. I have the
following code in the first text box:
Private Sub IQ1_Score_AfterUpdate()
On Error GoTo Err_IQ1_Score_AfterUpdate
If Me.IQ1_Score > 10 Or Me.IQ1_Score < 0 Then
MsgBox "Value should be between 1 and 10.",
vbExclamation, "Notice:"
Me.IQ1_Score.SetFocus
Else
'Recalculates all ten fields and updates the "Total"
'Me.Total_Case_Score = "(Me.IQ1_Score) +
(Me.IQ2a_Score) + (Me.IQ2b_Score) + (Me.IQ2c_Score) +
(Me.IQ3a_Score) + (Me.IQ3b_Score) + (Me.IQ3c_Score) +
(Me.IQ3d_Score) + (Me.IQ4_Score) + (Me.IQ5_Score)"
End If
Exit_IQ1_Score_AfterUpdate:
Exit Sub
Err_IQ1_Score_AfterUpdate:
MsgBox Err.Description
Resume Exit_IQ1_Score_AfterUpdate
End Sub
I have the following code in the other 9 text boxes:
Call IQ1_Score_AfterUpdate
My problem: when I run the form and go to enter a number
in a field I get a error message saying, "The value you
entered isn't valid for this field."
I am not sure where the problem is? The form's control
source is the underlying table... not sure where to start
looking to solve the problem.
Thanks!!!!!!!