473,385 Members | 1,693 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,385 software developers and data experts.

Delete record crashes access

29
Every time i attempt to delete a record access crashes

i have a main form
[Progdate]

a sub form
[Meeting ID]

and a sub sub form
[Attendance]

so long as i do not expand the sub sub form i can delete the record form th esub form

but if i expand the sub sub form it crashes

is there a way to avoid this
Jan 21 '09 #1
4 2726
puppydogbuddy
1,923 Expert 1GB
If you have the Master/Child links setup between the form and between the nested subforms, the following code behind the form from which you select the record to be deleted should work:
Expand|Select|Wrap|Line Numbers
  1.     DoCmd.RunCommand acCmdSelectRecord
  2.     DoCmd.RunCommand acCmdDeleteRecord
  3.  
If it does not work, post the master/child links between the nested subforms and the main form.
Jan 22 '09 #2
frys
29
im sorry for sounding new.

But do i put this code on the "On Delete" event or .. well i just don't know

i really appreciate the help
Jan 23 '09 #3
puppydogbuddy
1,923 Expert 1GB
No, place the code behind a button on your form, as shown below:
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnDelete_Click()
  2. On Error GoTo Err_btnDelete_Click
  3.  
  4. Dim Cancel As Integer
  5. Dim intReturn As Integer
  6.  
  7. On Error GoTo Err_btnDelete_Click
  8.  
  9. intReturn = MsgBox("Warning: You are about to delete this record. If you don't want to do this, Click the cancel button.", vbOKCancel)
  10.  
  11. If intReturn = vbCancel Then
  12.         GoTo Exit_btnDelete_Click
  13. Else
  14.          DoCmd.RunCommand acCmdSelectRecord 
  15.          DoCmd.RunCommand acCmdDeleteRecord
  16.          Me.Refresh
  17. End If
  18.  
  19. Exit_btnDelete_Click:
  20.     Exit Sub
  21.  
  22. Err_btnDelete_Click:
  23.     MsgBox "Error# " & Err.Number & " " & Err.Description
  24.     Resume Exit_btnDelete_Click
  25.  
  26. End Sub
  27.  
Jan 23 '09 #4
frys
29
ah i see

thanks ill give that a shot
Jan 23 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Steve | last post by:
I have several pairs of synchronized subforms in an application. I have a Delete button for each pair that uses the following code or similar to delete a record in the second subform: ...
4
by: Stephen | last post by:
Hello People, Using MS Access 2003 VBA I get the error 3020 Update or CancelUpdate without AddNew or Edit when I run through the following code. Can anyone help suggest anything to try? Thanks....
4
by: Susan Bricker | last post by:
I have a command button on a form that is supposed to Delete the record being displayed. The record is displayed one to a form. The form is not a Pop-Up nor is it Modal. Tracing the btnDelete...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
19
by: rich | last post by:
I am building an app using php and postgresql. My questionis this. How do you handle people wanting to make parallel changes to a record. Since in web apps you are doing a select, bring over a...
5
by: streamkid | last post by:
i have a class table, which has a vector of records(-db). i 'm trying to remove an element, but it doesn't seem to work.. i read this http://www.cppreference.com/cppvector/erase.html] and that's...
10
beacon
by: beacon | last post by:
Hi everybody, This is probably going to sound unorthodox, but I have to log records that are deleted...I know, go figure. Anyway, I have a form with a (continuous) subform, and on the subform I...
31
by: matthewslyman | last post by:
I have an unusual design and some very unusual issues with my code... I have forced Access to cooperate on everything except one issue - record deletion. My form design involves a recursively...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.