I would like to delete the value of a Number field (ExerciseID) for a selected group of records in code. In the following code the ExerciseID is Number field. I get the following error when run the code: "Run Time Error: Data Type Conversion Error."
Set db = CurrentDb
strSQL = "SELECT * FROM qryTemplateDetail WHERE (((qryTemplateDetail.TemplateID)=" & ID & "));"
Set rstDelete = db.OpenRecordset(strSQL)
If IsNull(Me.frmTemplateDetailSub!TemplateID) Then
DisplayMessage ("There are no records to delete.")
Do While Not rstDelete.EOF
!ExerciseID = ""
If I change the "" to Null, (ie. !ExerciseID = Null), during the next sequence of code I get the following error: "You tried to assign the Null variable that is not a Variant data type."
Is there a way around this? Could I change the Number data type to a Variant on the fly? Thanks.