Hello, I am currently doing a VB project for a course, I have all the features working bar the datagrid, when i use the program without the datagrid it works perfectly, however if i put a datagrid in I can only add and delete, but I am unable to cancel as the datagrid gives me an error, I have looked everywhere to get a solution and even asked my course tutor but no luck, so any help will be agreatly appreciated.
The code for my Add/Cancel command is;
Private Sub cmdSave_Click()
'Save the current record
On Error GoTo HandleSaveErrors
adoPhones.Recordset.Update
txtProductCode.Locked = True
EnableButtons
cmdSave.Enabled = False
cmdAdd.Caption = "Add"
cmdSave_Click_Exit:
Exit Sub
HandleSaveErrors:
Dim strMessage As String
strMessage = "Record could not be saved." & vbCrLf & vbCrLf _
& Err.Description
MsgBox strMessage, vbExclamation, "Database Error"
SetUpAddRecord
Resume cmdSave_Click_Exit
End Sub
Thank you very much DW :)