Private Sub CarPurchased_Click()
On Error GoTo CarPurchased_Err
Dim intAnswer As Integer
Dim strSQL As String
intAnswer = MsgBox("Would you like to update new cars?", vbQuestion + vbYesNo, "Cars Purchased")
If intAnswer = vbYes Then
DoCmd.OpenForm "CarPurchased", Datamode:=acFormAdd, WindowMode:=acDialog, OpenArgs:=CurrentRecord
DoCmd.SetWarnings False
DoCmd.SetWarnings True
MsgBox "The new value has been added to the list.", vbInformation, "Value Added"
Response = acDataErrAdded
Else
MsgBox "Please choose a value from the list.", vbInformation, "Value Not in List"
Response = acDataErrContinue
End If
CarPurchased_Exit:
Exit Sub
CarPurchased_Err:
MsgBox Err.Description, vbCritical, "Error"
Resume CarPurchased_Exit
End Sub