Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Error number -2147417848: Method ‘FindFirst’ of object ‘Recordset2’ failed.
- Private Sub Form_BeforeUpdate(Cancel As Integer)
- On Error GoTo ErrorHandler
- Dim strMsg As String
- Dim iResponse As Integer
- 'Specify the mesage to display
- strMsg = "Do you wish to save the changes?" & Chr(10)
- strMsg = strMsg & "Click Yes to Save or No to Discard changes."
- 'Display the msg box
- iResponse = MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?")
- 'Check response
- If iResponse = vbNo Then
- 'Undo the change.
- MsgBox "undo"
- DoCmd.RunCommand acCmdUndo
- 'Cancel the update
- Cancel = True
- End If
- Exit Sub
- ErrorHandler:
- MsgBox "Error number " & Err.Number & ": " & Err.Description
- End Sub
- Private Sub cboSalePicker_AfterUpdate()
- On Error GoTo ErrorHandler
- Me.Recordset.FindFirst "[SaleID] = " & Str(Nz(cboSalePicker.Value, 0))
- Exit Sub
- ErrorHandler:
- MsgBox "Error number " & Err.Number & ": " & Err.Description
- End Sub
Add Comment
Please, Sign In to add comment