Using Record Selectors

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have a continuous form with record selectors enabled. I figured out how
to use docmd.runcommand acCmdDeleteRecord to delete the record that is
selected using the record selectors. My question is how can I use the record
selectors to display a pop-up that says "are you sure you want to delete
record X with values 1, 2, 3?" So they can verify they selected the correct
record?

Thanks in advance, always a great place to get good answers!
 
Hi all,

I have a continuous form with record selectors enabled. I figured out how
to use docmd.runcommand acCmdDeleteRecord to delete the record that is
selected using the record selectors. My question is how can I use the record
selectors to display a pop-up that says "are you sure you want to delete
record X with values 1, 2, 3?" So they can verify they selected the correct
record?

Thanks in advance, always a great place to get good answers!

You can use the BeforeDeleteConfirm event to pop a message. Set Cancel
to TRUE if they don't want it deleted.

John W. Vinson[MVP]
 
Well if I select the record, with the record selector, say record 1. Hit the
delete key, it removes the record from view, my beforedeleteconfirm codes
runs which is just :

Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)

If MsgBox("Are you sure you want to delete?" & vbCrLf & "SiteID: " &
Me.SiteID & _
vbCrLf & "Name: " & Forms!frmSites!Name & vbCrLf & "Location: " &
Me.Location, vbYesNoCancel, "Del Confirm") = vbYes Then
MsgBox "Yes"
Else
MsgBox "no"
End If

End Sub

And it displays the wrong record. It is like it removes it from view and
sets the record selector to the next record.. runs the code, which asks about
the wrong record, then I click no in Access' premade warning and the record
comes back. How can I get it to display a warning for the record info you
are about to delete?
 
Back
Top