The query on it's own . . . Runs - right?
I'm not sure I needed to see the SQL after all . . . sorry.
What might be happening is that when the Task Number is not found in TabTask - you have Null values across the board . . . and then your Form tries to perform the calculations in the calculated fields using Nulls.
I created a quick and simple Form based on a Parameter query [Student] and then put a text box on it to Add the values in three of the fields on the Form that come from the query.
When I run the Form for a Student that is in the Table - it adds the three marks the student received on three different tests.
When I run the Form for a Student that is in NOT the Table - it shows blanks in all the fields - and a 0 in the calculated field.
I even changed the code to Average the three marks - and it still worked.
I was not able to re-recreate your problem.
Could you tell me what calculations you are doing?
I have to add that I was performing the calculations using VBA Code [very elementary code - fear not!!
] in the OnCurrent Event of the Form.
This is the VBA Code I used:
Code:
Private Sub Form_Current()
Dim int1, int2, int3 As Integer
txt1.SetFocus
int1 = Val(txt1.Text)
txt2.SetFocus
int2 = Val(txt2.Text)
txt3.SetFocus
int3 = Val(txt3.Text)
Me.Text20 = (int1 + int2 + int3) / 3
End Sub
Could you perhaps post a stripped-down versoin of your database here?