473,399 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How to prevent delete ?

Sal
How can I prevent deleting of the record in subform by pressing "Delete"
button on keyboard when record is selected, but still allow VB to delete
record when needed.

Thank You
Sal
Nov 13 '05 #1
1 4578
Set the subform's AllowDelete property to No, and programmatically delete
the record from the form's RecordsetClone like this:

If Me.Dirty Then
Me.Undo
End If
If Me.NewRecord Then
Beep
Else
With Me.RecordsetClone
.Bookmark = Me.Bookmark
.Delete
End With
End If
That gives no warning. Add a MsgBox() if you wish.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Sal" <sl*****@bellatlantic.net> wrote in message
news:gYuMc.508$NV3.70@trndny01...
How can I prevent deleting of the record in subform by pressing "Delete"
button on keyboard when record is selected, but still allow VB to delete
record when needed.

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: penny336 | last post by:
dear all, i am using vc++ 6.0 sp5 i have a class called Address,it allocated some memory space for streetname and city i first define it as Address add = new Address("Madrian","UK"); ......
1
by: Jon | last post by:
Hi all! Are there any other way than using rights or Triggers to prevent a DELETE or an UPDATE on a specific column. The "problem" with rights is that they dont apply to all DB-users The...
6
by: Squeamz | last post by:
Hello, Say I create a class ("Child") that inherits from another class ("Parent"). Parent's destructor is not virtual. Is there a way I can prevent Parent's destructor from being called when a...
7
by: L Mehl | last post by:
Hello -- In a form text field for entering stock symbols, I want to allow only: alpha integer decimal backspace left and right arrows delete shift
6
by: deko | last post by:
Is there a way to set a custom property on Access tables and/or queries to prevent them from being overwritten by import wizards? Any Access database can be easily destroyed if a user mistakenly...
10
by: mttc | last post by:
I read articles that suggest preventing delete by throwing Exception from RowDeleting Event. I not understand where I can catch this Error?
5
by: Maria Anthonsen | last post by:
I have filled a datagrid with data from a dataset. The dataset was filled with a dataadapter - and I used the wizard to create insert, update, delete commands. I would like to prevent the user...
1
by: Chris | last post by:
We have offer a web space to hosting our client website. We offer them to upload asp files to their web space. How can I prevent the client from uploading asp files that will harm our web server....
11
by: ariel81 | last post by:
i have created a function to input data from four textboxes into a table. how do i prevent duplicate records of the same mth/Yr into the table? editing of the data in the table with reference to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.