Check Box on a form.

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

Every time I add a new record and leave the check box
unchecked, I'll get the error bellow.

Error No: -2147217887; Description: Multiple-step OLE DB
operation generated errors. Check each OLE DB status
value, if available. No work was done.

This is a Yes/No field on the table.

When pointing in top of the words !GoodStudents =
GoodStudents it will show Null.
Is this the problem? If so, how do I fix it?


Private Sub AddStudent(StudID)
Dim rs As ADODB.Recordset
Set cnn = CurrentProject.Connection
Set rs = New ADODB.Recordset
On Error GoTo err_SaveStud
rs.Open "TblStud", cnn, adOpenStatic, adLockOptimistic
If lngStuID = 0 Then
rs.AddNew
Else
rs.Find "StudentNoID = " & lngStuID
If rs.EOF Then
Beep
MsgBox "can't find this record"
GoTo Exit_SavePolicy
End If
End If

With rs
!Name = txtname
!GoodStudents = GoodStudents
..Update
End With

Thanks
Tim
 
CheckBox on a Form can have 3 value: True, False AND Null. Obviously, you
cannot set a Boolean Field to Null since the only 2 possible values are True
& False.

Try setting the DefaultValue of the CheckBox to either True on False.
 
true or false

Van T. Dinh said:
CheckBox on a Form can have 3 value: True, False AND Null. Obviously, you
cannot set a Boolean Field to Null since the only 2 possible values are True
& False.

Try setting the DefaultValue of the CheckBox to either True on False.
 
Back
Top