PopulateDataSet() populate the controls on the form with
PopulateDataSet() populate the controls on the form with the same contact record prior to the updatePopulateControlsOnForm() Exit Subhandleerror: MsgBox( An error occurred in btnSave_Click: & Err.Number & - & _ Err.Description) Exit SubEnd Sub19.Add the following btnAddNew_Clickevent procedure to the form so the code executes whenthe Add button is clicked. This clears the form so that a new record can be added. Private Sub btnAddNew_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles btnAddNew.ClickOn Error GoTo handleerror clear the controls on the formClearForm() enable add modeblnAddMode = TrueExit Subhandleerror: MsgBox( An error occurred in btnAddNew_Click: & Err.Number & - & _ Err.Description) Exit SubEnd Sub20.Add the following btnDelete_Clickevent procedure to the form so the code executes whenthe Delete button is clicked. This procedure deletes the record from the local dataset but notfrom the underlying Access database. The user must also click the Save button to make thechanges in the database final. Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles btnDelete.ClickOn Error GoTo handleerrorDim intResponse As IntegerintResponse = MsgBox( Delete current record from the local dataset? , _ MsgBoxStyle.YesNo, Delete Record? ) If intResponse = vbYes ThencontactDS.Tables( Contacts ).Rows(intCurRecord).Delete() 246Chapter
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Mac Web Hosting services