When I add a button and choose in the wizzard for Delete Record
operation, it does not work, instead it ADD's a record? How come?
This is the VB contents of the button:
Private Sub CmdDelete_Click()
On Error GoTo Err_CmdDelete_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_CmdDelete_Click:
Exit Sub
Err_CmdDelete_Click:
MsgBox Err.Description
Resume Exit_CmdDelete_Click
End Sub
Bart
Acc 2003 2 1371
AA Arens wrote:
When I add a button and choose in the wizzard for Delete Record
operation, it does not work, instead it ADD's a record? How come?
This is the VB contents of the button:
Private Sub CmdDelete_Click()
On Error GoTo Err_CmdDelete_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_CmdDelete_Click:
Exit Sub
Err_CmdDelete_Click:
MsgBox Err.Description
Resume Exit_CmdDelete_Click
End Sub
Bart
Acc 2003
Very strange! I have just copied and pasted the code into a newly
created button and Hey Presto it deletes. Can only suggest you try the
same thing, i.e. create a new button and copy and paste the code into
it.
Still no result. I even tried to copy grom another databse, but the VB
text is the same. I also tried to open the databse from another PC,
same problem.
I also have choosen Menu Tools Compact and Repair Database.
Is there another way to delete a record from a form, so I can check
whether the delete record is blocked at all or not.
There are no problems in other (sub-)forms of the same database.
Bart
Tanis wrote:
AA Arens wrote:
When I add a button and choose in the wizzard for Delete Record
operation, it does not work, instead it ADD's a record? How come?
This is the VB contents of the button:
Private Sub CmdDelete_Click()
On Error GoTo Err_CmdDelete_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_CmdDelete_Click:
Exit Sub
Err_CmdDelete_Click:
MsgBox Err.Description
Resume Exit_CmdDelete_Click
End Sub
Bart
Acc 2003
Very strange! I have just copied and pasted the code into a newly
created button and Hey Presto it deletes. Can only suggest you try the
same thing, i.e. create a new button and copy and paste the code into
it.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: cfxchange |
last post by:
I am looking into work-arounds for what seems to be a flaw, or
"undocumented feature" of SQL Server replication and Instead of Delete
triggers not playing together. It seems that if you want to...
|
by: (Pete Cresswell) |
last post by:
Seems like when there's a 1:1 relationship, the order of referential integrity
enforcement depends on which way you drag the mouse pointer when drawing the
relationship line.
If you drag from...
|
by: Norman Fritag |
last post by:
Hi there,
I have one subform in a Master form, which is set to add mode only.
I allow only for data entry. Sofar all words fine.
All information on the main form is set for display only and have...
|
by: Melissa |
last post by:
What is the code to delete a command button from a form? Can the code be run
from the click event of the button to be deleted?
Thanks!
Melissa
|
by: John Michael |
last post by:
Is it possible to detect when someone has pushed their Esc button on a form.
When a form is open and someone is adding a record, if they push the esc
button, the whole form gets reset to an empty...
| |
by: Jacko |
last post by:
I have a jazz records archive database which is supposed to be
updatable via an input form.
Despite setting the form's properties so that it will accept edits,
deletes etc the new record button...
|
by: Mike N. |
last post by:
If a user fills in some fields on a form, then decides not to enter the
record, what method is used to cancel the record? Everything I try, still
adds the record to the table. I'd just like to...
|
by: Kevin |
last post by:
A couple of easy questions here hopefully. I've been working on two
different database projects which make use of multiple
forms.
1. Where's the best/recommended placement for command buttons...
|
by: martin |
last post by:
Hello,
Is there a way to make a kind of "cancel" button on a form?
Suppose you accidently changed or overwrote some data in a form, then I'd
like to leave this form at once and cancel any...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |