I want to password protect my delete command, so only users that know the correct password can delete the record. I'm really not sure how to go about this, because I'm still a beginner, but my code for the delete command is below.
Any help is appreciated!
Thanks,
Heather
'-----------------------------------------------------------------------------
Private Sub cmdDelete_Click()
'-----------------------------------------------------------------------------
On Error GoTo LocalError
If MsgBox("Are you sure you want to delete this record?", _
vbYesNo + vbQuestion, _
"Delete") = vbNo Then
Exit Sub
End If
mobjADORst.Delete
mobjADORst.Requery
'reposition after delete
mobjADORst.Find "ASSET_NUMBER > " & txtAssetNumber.Text
If mobjADORst.EOF Then mobjADORst.MoveLast
'load data
Call PopulateFormFields
Exit Sub
LocalError:
MsgBox Err.Number & " - " & Err.Description
End Sub
Any help is appreciated!
Thanks,
Heather
'-----------------------------------------------------------------------------
Private Sub cmdDelete_Click()
'-----------------------------------------------------------------------------
On Error GoTo LocalError
If MsgBox("Are you sure you want to delete this record?", _
vbYesNo + vbQuestion, _
"Delete") = vbNo Then
Exit Sub
End If
mobjADORst.Delete
mobjADORst.Requery
'reposition after delete
mobjADORst.Find "ASSET_NUMBER > " & txtAssetNumber.Text
If mobjADORst.EOF Then mobjADORst.MoveLast
'load data
Call PopulateFormFields
Exit Sub
LocalError:
MsgBox Err.Number & " - " & Err.Description
End Sub