The code below works in that I can insert records into the recordset.
Sub SaveRecord()
With rsRecord
.AddNew
![projid] = Me!Proj_Id
![ProjName] = Me!Proj_Name
![CatId] = Me!Cat_Id
.Update
End With
End Sub
As long as the values are valid against the field definition of the table. For example projid is string with len of 10. The problem starts when I enter more than 10 charcater. At first, I get an error message indicating that the string is too long for DB field. after which, I make the correction but when I get to executing the AddNew again, the value for projid does not get set to that of the me!proj_id from the form. It as though after an error it ignores resetting the values and it throws an exception.
Is there something I'm missing? Do I have to clear any error conditions after a failed ADO event?
I greatly appreciate your help.
Salzan
Sub SaveRecord()
With rsRecord
.AddNew
![projid] = Me!Proj_Id
![ProjName] = Me!Proj_Name
![CatId] = Me!Cat_Id
.Update
End With
End Sub
As long as the values are valid against the field definition of the table. For example projid is string with len of 10. The problem starts when I enter more than 10 charcater. At first, I get an error message indicating that the string is too long for DB field. after which, I make the correction but when I get to executing the AddNew again, the value for projid does not get set to that of the me!proj_id from the form. It as though after an error it ignores resetting the values and it throws an exception.
Is there something I'm missing? Do I have to clear any error conditions after a failed ADO event?
I greatly appreciate your help.
Salzan
Comment