Information générale
Titre:
Validation of fields before adding a record
I have a form with textboxes (fields). When the user presses the Add Record button, the program validates the info in each textbox .
I have a problem with the validation of the first field of the record:
when the info in the first field is OK, the program runs fine (the record is added)
when the info in the first field is wrong, I get the following error message:
Can not insert an empty row must have at lest one column value set.
and the .addnew line is higlighted
here are a few lines of the code:
With frmDelivrep.Adodc1.Recordset
.AddNew
If Not AllCtrlFiles.CheckTelco(frmAddDelivrep, txtTelco, lblTelco) Then GoTo TelcoExit
.Fields!telco = txtTelco.Text
TelcoExit:
Exit Sub
I think the problem is the program is expecting to add a record but because no fields are filled since the validation of the first field fails, I get an error. I have tried to update and to requry the recordset but I get the same error.
THank you,
Dominique Plante
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement