Hi Guys,
Have a strange error going on that makes no sense. I'm getting the error tblCards.Description cannot be a zero length string while trying to save a record. The field in question is a long text field and is not required and does not allow zero length strings. At the time of entering the record I am only entering data in the Card Name Field. All other fields are left blank. I have entered records before and left this field blank without issue. Now Access is raising an error. Don't understand what's going on. Any help you can provide is appreciated. Here's the procedure being executed at the time of the error.
Code:
Private Sub SaveCardData(ByVal sNewKey As String)
Dim vCardType As Variant
If Not IsNull(sNewKey) Then
rsCards("Card ID") = sNewKey
End If
If Not IsNull(txtCardName.Text) Then
rsCards("Card Name") = txtCardName.Text
End If
If cmbCardCategory.ListIndex > -1 Then
rsCards("Category ID") = cmbCardCategory.Value
End If
If cmbCardAttribute.ListIndex > -1 Then
rsCards("Attribute ID") = cmbCardAttribute.Value
End If
If cmbCardCategory.Value = "M" Then
txtLevel.SetFocus
If Not IsNull(txtLevel.Text) Then
rsCards("Level") = txtLevel.Text
End If
If cmbMonsterType.ListIndex > -1 Then
rsCards("Monster ID") = cmbMonsterType.Value
End If
txtAttackPoints.SetFocus
If Not IsNull(txtAttackPoints.Text) Then
rsCards("Attack Points") = txtAttackPoints.Text
End If
txtDefensePoints.SetFocus
If Not IsNull(txtDefensePoints.Text) Then
rsCards("Defense Points") = txtDefensePoints.Text
End If
If lstCardType.ItemsSelected.Count > 0 Then
For Each vCardType In lstCardType.ItemsSelected
If lstCardType.ItemData(vCardType) = "PDM" Then
txtPendulumScale.SetFocus
If Not IsNull(txtPendulumScale.Text) Then
rsCards("Pendulum Scale") = txtPendulumScale.Text
End If
txtLink.SetFocus
If Not IsNull(txtLink.Text) Then
rsCards("Link") = txtLink.Text
End If
Exit For
End If
Next vCardType
End If
End If
txtDescription.SetFocus
If Not IsNull(txtDescription.Text) Then
rsCards("Description") = txtDescription.Text
End If
rsCards("Forbidden") = chkForbidden.Value
rsCards.Update
rsCards.Bookmark = rsCards.LastModified
SaveCardTypeData (sNewKey)
End Sub