L
Laurel
Even though the table tblScores allows nulls in Contract, and has a lot of
rows with null, when li_contract, below is set to Null, the SQL is invalid.
The error message shows the SQL looks like this.
Insert into
tblScores(Student_ID,Score_Date,Period_Code,Safety,On_Task,Respect,Language,
Transition,Homework,Contract) VALUES (64,
#10/26/2004#,'L',5,5,5,5,5,Null,5)
And this is the error message
Invalid use of Null
Dim li_contract as integer
If ls_temp = Null Or ls_temp = "" Then
li_contract = Null
Else
li_contract = ai_value
End If
ls_sql = "Insert into tblScores(Student_ID,Score_Date,Period_Code" _
&
",Safety,On_Task,Respect,Language,Transition,Homework,Contract) " _
& " VALUES (" & !Student_ID _
& ", #" & adt_date & "#," _
& "'" & lrst_Periods!Period_Code & "'," _
& ai_value & "," _
& ai_value & "," _
& ai_value & "," _
& ai_value & "," _
& ai_value & "," _
& ls_homework & "," _
& li_contract & ")"
rows with null, when li_contract, below is set to Null, the SQL is invalid.
The error message shows the SQL looks like this.
Insert into
tblScores(Student_ID,Score_Date,Period_Code,Safety,On_Task,Respect,Language,
Transition,Homework,Contract) VALUES (64,
#10/26/2004#,'L',5,5,5,5,5,Null,5)
And this is the error message
Invalid use of Null
Dim li_contract as integer
If ls_temp = Null Or ls_temp = "" Then
li_contract = Null
Else
li_contract = ai_value
End If
ls_sql = "Insert into tblScores(Student_ID,Score_Date,Period_Code" _
&
",Safety,On_Task,Respect,Language,Transition,Homework,Contract) " _
& " VALUES (" & !Student_ID _
& ", #" & adt_date & "#," _
& "'" & lrst_Periods!Period_Code & "'," _
& ai_value & "," _
& ai_value & "," _
& ai_value & "," _
& ai_value & "," _
& ai_value & "," _
& ls_homework & "," _
& li_contract & ")"