hi all

Can anybody help me with the vb6 datagrid error control code.When I click addnew all textboes are cleared and the datagrid sets focus to an empty row but when I decide to click cancel update, I get a msg that "row cannot be inserted,row must have at least one column value set".

this is the coce for my cancel button:

Private Sub cmdCancel_Click()
On Error Resume Next
Adodc1.Recordset.CancelUpdate
ClearText
End Sub

this happens because you have no records in your database yet. If you can,you can use ADODB instead of ADODC method,because it does not happen when you use ADODB....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.