473,796 Members | 2,462 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem deleting

Hi,

I'm running Access 2002 and have a problem deleting records on a
continuous form.
I thought it might be due to relationships with two other tables but
having deleted these relationships, I'm still not able to delete a
record.

The code I am using is as follows:-

yn = MsgBox("Are you sure to delete all this person's details
permanently??", vbYesNo, "Save")
If yn = vbNo Then
MsgBox ("record not deleted")
Else

DoCmd.DoMenuIte m acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuIte m acFormBar, acEditMenu, 6, , acMenuVer70
End If
Can anyone see anything wrong?

Yvonne

Dec 23 '06 #1
11 1858
You don't say where you have this code, but I'm guessing you have it behind a
command button. If that's the case, I think the problem is that when you
click on the button, you've taken focus away from the record you want to
delete so there is, on a continuous form, no current record, and without a a
current record, Access doesn't know which record you want to delete! Try
placing the code in the DoubleClick event of one of your controls, say the
person's name, doubleclick that control, and see if it works.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200612/1

Dec 23 '06 #2

missinglinq via AccessMonster.c om wrote:
You don't say where you have this code, but I'm guessing you have it behind a
command button. If that's the case, I think the problem is that when you
click on the button, you've taken focus away from the record you want to
delete so there is, on a continuous form, no current record, and without a a
current record, Access doesn't know which record you want to delete! Try
placing the code in the DoubleClick event of one of your controls, say the
person's name, doubleclick that control, and see if it works.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200612/1
Yes it's behind a command button. An adjacent button that opens up a
separate form ( frmDetails) with full details of the record works OK
and frmDetails opens up.

I tried the double-click event proceedure but that didn't work.

I checked and the continuous form allows Edits and Deletions.

I put a command button to delete the record on frmDetails but that
didn't work also.

Weird, huh?

Yvonne

Dec 23 '06 #3
>Yvonne wrote:
I put a command button to delete the record on frmDetails but that
didn't work also.

Weird, huh?

Yvonne
Update....

It's got to be something to do with this code becuse when I take it
out, the delete goes through OK. And a simple delete command button on
frmDetals works OK also.

yn = MsgBox("Are you sure to delete all this person's details
permanently??", vbYesNo, "Save")
If yn = vbNo Then
MsgBox ("record not deleted")
Else

Does this help?

Yvonne

Dec 23 '06 #4
All the testing I did was with forms that were based on queries, the only way,
really, that serious developer do forms. After much fussing about, it
occurred to me to try the code on a form directly based on a table, and voila!
It ddn't work! I don't know the ends or outs, but that appears to be the
answer. Is your form, in fact, based directly on a table? If so, do up a
simple query with the appropriate fields, then change the Record Source of
your form to this new query and try out the delete code in either the
doubleclick event or behind a button event. If this isn't the case, I don't
know what else to tell you.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200612/1

Dec 23 '06 #5
Our last posts crossed in the ether! I don't know what to add to my last post.
Using your code

yn = MsgBox("Are you sure to delete all this person's details permanently??",
vbYesNo, "Save")
If yn = vbNo Then
MsgBox ("record not deleted")
Else
DoCmd.DoMenuIte m acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuIte m acFormBar, acEditMenu, 6, , acMenuVer70
End If

I have no problem unless the form is based directly on a table.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200612/1

Dec 23 '06 #6
Yvonne wrote:
It's got to be something to do with this code becuse when I take it
out, the delete goes through OK. And a simple delete command button on
frmDetals works OK also.
If I were doing this I wouldn't. I've paid $200 or so for Access which
provides me with menu options and key options (<Delete>) that delete
records perfectly time after time after time. (The default condition of
the From is to ask for verification.) Why would I want to code this
behind a button? Windows is a menu driven technology. The presence of
buttons on Access forms more often than not says, "Flounderin g Amateur"
or, "Obstinate Neanderthal".

If I had a friend who insisted on doing this despite my advice I would
suggest to him/her that first the delete be tested by pressing the
delete key.

If that delete (<Delete>) worked I would suggest that the inane menu
calls be replaced with:

With DoCmd
.RunCommand acCmdSelectReco rd
.RunCommand acCmdDeleteReco rd
End With

Dec 23 '06 #7

End If

I have no problem unless the form is based directly on a table.
>
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200612/1
Hi again,

I changed the data source so that it was based on the table directly
and it still didnt work. The simple delete command button created with
the wizard ( ie no yn MsgBox) works fine -whether it's based on the
table or query.

Yvonne

Dec 23 '06 #8

Lyle Fairfield wrote:
>. The presence of
buttons on Access forms more often than not says, "Flounderin g Amateur"
or, "Obstinate Neanderthal".
I guess I could be acused as being a bit of both of these so I'll
gladly take your advice and get rid of the code. Life's too short to
spend too much time trying "to guild the lily".

Many thanks for your help.

Yvonne

Dec 23 '06 #9
"Yvonne" <lo********@yah oo.comwrote in news:1166888682 .156549.66800
@i12g2000cwa.go oglegroups.com:
Lyle Fairfield wrote:
>The presence of
buttons on Access forms more often than not says, "Flounderin g Amateur"
or, "Obstinate Neanderthal".

I guess I could be accused as being a bit of both of these ....
There's hope for the first. Concentrate on that!

--
Lyle Fairfield
Dec 23 '06 #10

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

Similar topics

6
2433
by: Matan Nassau | last post by:
Hello. i have a composite which i want to delete. this is a composite which represents a boolean expression (see a previous post of mine with more details at http://groups.google.ca/groups?hl=en&lr=&ie=UTF-8&threadm=AXqqc.89218%24PJ1.865449%40wagner.videotron.net&rnum=1&prev=/groups%3Fq%3Dmatan%2Bnassau%26hl%3Den%26lr%3D%26ie%3DUTF-8%26sa%3DG%26scoring%3Dd ) VariableExp *x = new VariableExp("X"); VariableExp *y = new VariableExp("Y");...
9
2937
by: Venn Syii | last post by:
I have the following line of code: if (MyData) { delete MyData; MyData= NULL; } Below is MyData: SomeDataStructure *MyData;
2
9291
by: Chris Bolus | last post by:
I'm a teacher using MS Access on an RMConnect 2.4 network. On some workstations both I and my students sometimes get an error message when attempting to insert a command button on a form which reads "Invalid use of null". The remainder of the options in the Command Button Wizard are then unavailable and the button wil not work. The only solution is to log on to a different workstation. Any ideas?
13
9539
by: Bob Darlington | last post by:
I have a repair and backup database routine which runs when a user closes down my application. It works fine in my development machine, but breaks on a client's at the following line: If Dir(strLDB) <> "" Then Kill (strLDB) where strLDB is the path to the ldb file. The client advises that the ldb doesn't lurk after the program closes. Any ideas?
0
1415
by: Hrvoje Vrbanc | last post by:
Hello, this is a problem I came upon while building a site based on MCMS 2002 but it's not strictly MCMS-oriented: I have a page that displays a certain content in presentation mode but when an editor clicks "Switch To Edit Site" in MCMS console on the page, the page displays a different content, an interface that editor use for upload and deleting files on the web server. There are no problems with the upload but there is a problem...
5
2693
by: George | last post by:
VB.net 2003 standard, XP windows home edition. Installed first application OK today. When I removed the application via Control Panel, there were no problems and the app folders were deleted. But when I installed the app from a CD-ROM (Release folder is in D:), when I remove the app in Control Panel these problems occur: Control Panel does not delete the application folders. When I try to delete them I get message "Cannot delete file:...
0
2610
by: rokuingh | last post by:
ok, so i've been working on this one for quite a while, and the code is very big so i'm just going to give the relevant parts. this is a program that builds polymers (chemical structures of repeated monomers) which are represented as doubly pointed noncomplete binary trees. There are three different types of monomers (hence the three different constructer calling functions) the first one is the "leaves" of the tree, the second adds length...
14
1963
by: Sweeya | last post by:
/*Program to do manipulations on a string*/ #include <iostream> using namespace std; class String { int len; char *p;
2
3350
by: presencia | last post by:
Hi everyone, I have written a small program running fine until a Segmentation fault. Using a debugger I have localized the function the fault happens in. The Signal appears during a call to delete in the recursive function I have posted below. I have done some C coding before but I am fairly new to C++. I would really appreciate any help. I can't figure out where the problem is. The function the SIGSEGV appears in is the following. It...
1
1772
by: Kyosuke18 | last post by:
Hi everyone, I have a problem in deleting a data that is connected on the database.. I tried this code but it shows me an error: Run-time error '-2147217900(80040e14)': Syntax error in string in query expression 'ID=". Here is the code that i did: Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim ab As String cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\My...
0
9529
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10457
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10176
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9054
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6792
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5443
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4119
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.