Stop Record Deletion

J

Justin

I have a continous form based on a table. The form uses the record selector
function to allow users to easily delete un-wanted data. Some records will
now be uploaded into a differnt system. I have set-up a field to flag which
records have been uploaded. How can I keep the record selector, but stop
rows that have been uploaded (flagged) from being deleted?
 
D

Dirk Goldgar

Justin said:
I have a continous form based on a table. The form uses the record
selector
function to allow users to easily delete un-wanted data. Some records
will
now be uploaded into a differnt system. I have set-up a field to flag
which
records have been uploaded. How can I keep the record selector, but stop
rows that have been uploaded (flagged) from being deleted?


You could use the form's Delete event, like this:

'----- start of code -----
Private Sub Form_Delete(Cancel As Integer)

If Me.RecordUploaded = True Then
Cancel = True
MsgBox "Can't delete record " & Me.ID & _
" -- this record has been uploaded."
End If

End Sub
'----- end of code -----
 
S

Stuart McCall

Justin said:
I have a continous form based on a table. The form uses the record
selector
function to allow users to easily delete un-wanted data. Some records
will
now be uploaded into a differnt system. I have set-up a field to flag
which
records have been uploaded. How can I keep the record selector, but stop
rows that have been uploaded (flagged) from being deleted?

Use the form's Delete event procedure to cancel the deletion if flagged:

Cancel = (Me.FlagField = True)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top