[AccessD] Delete Record Problem

Rocky Smolin rockysmolin at bchacc.com
Wed May 10 19:18:25 CDT 2017


No.  I'll give that a try.  It would be cleaner than the kludge I'm
fashioned.

R


-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Bob
Walsh
Sent: Wednesday, May 10, 2017 3:39 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Delete Record Problem

Did you try:
        DoCmd.RunCommand acCmdSelectRecord
         DoCmd.RunCommand acCmdDeleteRecord

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Rocky Smolin
Sent: Wednesday, May 10, 2017 2:35 PM
To: 'Access Developers discussion and problem solving'
<accessd at databaseadvisors.com>
Subject: Re: [AccessD] Delete Record Problem

Yeah - first thought.  Even printed out the Allow Deletions property in the
delete module just to see if it was somehow getting turned off.   But no
cigar.

R


-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Steve Schapel
Sent: Wednesday, May 10, 2017 2:29 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Delete Record Problem

Hi Rocky

Ok, fair enough.

Here's another random thought... Check the Allow Deletions property of the
form?

Regards
Steve


-----Original Message-----
From: Rocky Smolin
Sent: Thursday, May 11, 2017 1:34 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Delete Record Problem

Steve:

It's a query " qrySocietyCourseOfferings".  Whe I run it a la carte I can
add, modify, and delete records.  So it is updateable.  Here's the SQL view:

SELECT tblShippingData_Society.fldSDSocOrgType,
tblSocietyCourseOfferings.fldSocietyCourseOfferingCourseNumber,
tblSocietyCourseOfferings.fldSocietyCourseOfferingID,
tblCourses.fldCourseName, tblSociety.fldSocietyName,
tblSocietyCourseOfferings.fldSocietyCourseOfferingPDFMaterialsOnly,
tblSocietyCourseOfferings.fldSocietyCourseOfferingJustMaterialsNoPDF,
tblDiscussionLeader.fldDLFirstName, tblDiscussionLeader.fldDLLastName,
tblSocietyCourseOfferings.fldSocietyCourseOfferingDate,
tblSocietyCourseOfferings.fldSocietyCourseOfferingName,
tblSocietyCourseOfferings.fldCourseID,
tblSocietyCourseOfferings.fldSocietyID,
tblSocietyCourseOfferings.fldDiscussionLeaderID,
tblSocietyCourseOfferings.fldSocietyCourseOfferingStateID,
tblSocietyCourseOfferings.fldSocietyCourseOfferingAHIMaterialsFee,
tblSocietyCourseOfferings.fldSocietyCourseOfferingRetailCourseFee,
tblSocietyCourseOfferings.fldSocietyCourseOfferingDays,
tblSocietyCourseOfferings.fldSocietyCourseOfferingCity,
tblSocietyCourseOfferings.fldSocietyCourseOfferingDiscussionLeader,
tblSocietyCourseOfferings.fldSocietyCourseOfferingMinimumParticipants,
tblSocietyCourseOfferings.fldSocietyCourseOfferingMaximumParticipants,
tblSocietyCourseOfferings.fldSocietyCourseOfferingTotalParticipants,
tblSocietyCourseOfferings.fldSocietyCourseOfferingRegisteredParticipants,
tblSocietyCourseOfferings.fldSocietyCourseOfferingRegisteredAsOf,
tblSocietyCourseOfferings.fldSocietyCourseOfferingComments,
tblSocietyCourseOfferings.fldSocietyCourseOfferingStatus,
tblSocietyCourseOfferings.fldSocietyCourseCancelledDate,
tblSocietyCourseOfferings.fldSocietyCourseOfferingYear,
tblSocietyCourseOfferings.fldSocietyCourseOfferingStrengthOfCourses,
tblSocietyCourseOfferings.fldSocietyCourseOfferingParticipantLetterSent,
tblSocietyCourseOfferings.fldSocietyCourseOfferingParticipantLetterStatus,
tblSocietyCourseOfferings.fldSocietyCourseOfferingCPEDirectorLetterSent,
tblSocietyCourseOfferings.fldSocietyCourseOfferingOKToMarket,
tblSocietyCourseOfferings.fldSocietyCourseOfferingStartMarketing,
tblSocietyCourseOfferings.fldSocietyCourseOfferingEndMarketing,
tblSocietyCourseOfferings.fldSocietyCourseOfferingSameCourseLastYearID,
tblSocietyCourseOfferings.fldSocietyCourseOfferingPriorCourseLastYearID,
tblDiscussionLeader.fldDLBasicRating,
tblDiscussionLeader.fldDLSemiSeniorRating,
tblDiscussionLeader.fldDLBeginningInChargeRating,
tblDiscussionLeader.fldDLSupervisoryRating,
tblDiscussionLeader.fldDLSupervisoryRating,
tblDiscussionLeader.fldDiscussionLeaderID,
tblSocietyCourseOfferings.fldSocietyCourseOfferingPreCourseMaterialsSent,
tblShippingData_Society.*, *
FROM (((tblSocietyCourseOfferings LEFT JOIN tblCourses ON
tblSocietyCourseOfferings.fldCourseID = tblCourses.fldCourseID) INNER JOIN
tblSociety ON tblSocietyCourseOfferings.fldSocietyID =
tblSociety.fldSocietyID) LEFT JOIN tblDiscussionLeader ON
tblSocietyCourseOfferings.fldDiscussionLeaderID =
tblDiscussionLeader.fldDiscussionLeaderID) LEFT JOIN tblShippingData_Society
ON tblSocietyCourseOfferings.fldSocietyCourseOfferingID =
tblShippingData_Society.fldCourseOfferingID
ORDER BY tblSociety.fldSocietyName,
tblSocietyCourseOfferings.fldSocietyCourseOfferingDate,
tblSocietyCourseOfferings.fldSocietyCourseOfferingName;



-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Steve Schapel
Sent: Tuesday, May 09, 2017 11:20 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Delete Record Problem

Hi Rocky

I'd be interested to know what is the Record Source of the form.

Regards
Steve

-----Original Message-----
From: Rocky Smolin
Sent: Wednesday, May 10, 2017 5:32 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Delete Record Problem

Yeah I tried that one after I failed with RunSQL.  They should all work
(I've used all three for 20 years) but there's something fishy about this
app and I guess I don't have the patience to get to the bottom of it. Maybe
it's time to hang up the mouse.

R


-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
Stuart McLachlan
Sent: Tuesday, May 09, 2017 8:51 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Delete Record Problem

or CurrentDb.Execute "Delete * from myTable...."

That avoids the need for "SetWarnings...." switching

On 9 May 2017 at 17:17, Doug Steele wrote:

> Hi Rocky:
>
> Can you delete a record manually from the recordset bound to the form?
> I've had problems in the past where the recordset won't allow 
> deletions.
>
> I know I've had a similar problem to you in the past - I think that I 
> got around it by using something like DoCmd.RunSQL "Delete * from 
> myTable where unique key = whatever"
>
> Doug
>
> On Tue, May 9, 2017 at 3:35 PM, Bill Benson <bensonforums at gmail.com>
> wrote:
>
> > It seems to me toy do not need a colon after on error goto IsIt2501.
> >
> > Is that perhaps causing the error code to be ignored and the msgbox 
> > announcing delete occurred to happen?
> >
> > From my non-flammable Note 3,
> > Bill Benson
> >
> > On May 9, 2017 6:28 PM, "Rocky Smolin" <rockysmolin at bchacc.com>
> > wrote:
> >
> > Dear List:
> >
> >
> >
> > I have a bound form.  With a delete button.  Behind the button is 
> > some simple code.  The line which runs the delete is being executed; 
> > "Delete Done" message is displayed.
> >
> >
> >
> > But the record is not being deleted.  It's still there!
> >
> >
> >
> > I've posted the delete module's code below.
> >
> >
> >
> > I have another form that does Accounting Firm Courses instead of 
> > Society Courses.  Same problem!
> >
> >
> >
> > Any idea why this simple command is not working?  This is an mdb 
> > being developed in A2010.
> >
> >
> >
> > MTIA
> >
> >
> >
> >
> >
> > Rocky Smolin
> >
> > Beach Access Software
> >
> > 760-683-5777
> >
> >  <http://www.bchacc.com> www.bchacc.com
> >
> >  <http://www.e-z-mrp.com> www.e-z-mrp.com
> >
> > Skype: rocky.smolin
> >
> >
> >
> >
> >
> >
> >
> > If IsNull(Me.fldSocietyCourseOfferingID) Then Exit Sub
> >
> >
> >
> > If gintAccessLevel < 3 Then
> >
> >     MsgBox "Read Write Access Required", , vbExclamation
> >
> >     Exit Sub
> >
> > End If
> >
> >
> >
> > On Error GoTo IsIt2501:
> >
> >
> >
> > Dim inI As Integer
> >
> >
> >
> >     intI = DCount("fldCourseOfferingID",
> >     "tblParticipantCourseOffering", _
> >
> >         "fldCourseOfferingID = " & Me.fldSocietyCourseOfferingID)
> >
> >
> >
> >     If intI <> 0 Then
> >
> >         intReply = MsgBox("This Course Offering appears in " & intI
> >         _
> >
> >             & " Particpant Course History record(s). " _
> >
> >             & vbCrLf & vbCrLf & "Deleting this Course Offering will
> >             delete
> > it from those Participant histories. " _
> >
> >                 & vbCrLf & vbCrLf & "Do you still wish to delete
> >                 this
> > Course
> > Offering?", vbYesNo)
> >
> >         If intReply = vbNo Then
> >
> >             MsgBox "Course Offering Not Deleted.", vbExclamation
> >
> >             Exit Sub
> >
> >         End If
> >
> >     End If
> >
> >
> >
> >     intReply = MsgBox("OK to Delete this course?", vbYesNo)
> >
> >     If intReply = vbNo Then
> >
> >         MsgBox "Delete Canceled.", vbExclamation
> >
> >         Exit Sub
> >
> >     End If
> >
> >
> >
> >
> >
> >     DoCmd.RunCommand acCmdDeleteRecord
> >
> >     MsgBox "Delete Done.", vbExclamation
> >
> >     Exit Sub
> >
> >
> >
> > IsIt2501:
> >
> >     If Err.Number = 2501 Then
> >
> >         Exit Sub
> >
> >     Else
> >
> >         MsgBox "Error: " & Err.Number & " - " & Err.Description
> >
> >     End If
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


________________________________
HealthInsight is a private, nonprofit, community-based organization
dedicated to improving health and health care, with offices in four western
states: Nevada, New Mexico, Oregon and Utah. HealthInsight also has
operations in Seattle, Wash., and Glendale, Calif., supporting End-Stage
Renal Disease Networks in the Western United States. The information and any
materials included in this transmission may contain confidential information
from HealthInsight. The information is intended for use by the person named
on this transmittal. If you are not the intended recipient, be aware that
any disclosure, copying, distribution, or use of the contents of this
transmission is prohibited. If you have received this message in error,
please inform the sender and delete all copies.


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list