N
Nomij
I am trying to create a form that pulls up a record from a drop down list. If
the data is modified, a msg box confirms the change, " Yes, No, Cancel".
Everything works except "cancel". When you come back to the form, I get Error
3020 as named above. I've included the code below. Does anyone have a
solustion to this? (Access 2003) Thanks for any help!
Private Sub Combo53_AfterUpdate()
'Find the record that matches the control.
On Error GoTo Err_CommandExit
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Customer Name] = '" & Me![Combo53] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Err_CommandExit:
Me![Combo53] = Me.Customer_Name
Me.Bookmark = Me.Bookmark
Exit Sub
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
'Confirm changes with user
Dim intAnswer As Integer
intAnswer = MsgBox("The Customer Info has been modified. Do you want to
save your changes?", vbYesNoCancel)
Select Case intAnswer
Case vbYes
Cancel = no
Case vbNo
Me.Undo
Case vbCancel
Cancel = True
End Select
End Sub
the data is modified, a msg box confirms the change, " Yes, No, Cancel".
Everything works except "cancel". When you come back to the form, I get Error
3020 as named above. I've included the code below. Does anyone have a
solustion to this? (Access 2003) Thanks for any help!
Private Sub Combo53_AfterUpdate()
'Find the record that matches the control.
On Error GoTo Err_CommandExit
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Customer Name] = '" & Me![Combo53] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Err_CommandExit:
Me![Combo53] = Me.Customer_Name
Me.Bookmark = Me.Bookmark
Exit Sub
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
'Confirm changes with user
Dim intAnswer As Integer
intAnswer = MsgBox("The Customer Info has been modified. Do you want to
save your changes?", vbYesNoCancel)
Select Case intAnswer
Case vbYes
Cancel = no
Case vbNo
Me.Undo
Case vbCancel
Cancel = True
End Select
End Sub