Rabu, 14 September 2011

RE: [MS_AccessPros] Record not deleting AARGH!!!

Connie,
Is the record source query updateable? When you open the datasheet can you edit/delete records?

Duane Hookom
MS Access MPV

To: MS_Access_Professionals@yahoogroups.com
From: no_reply@yahoogroups.com
Date: Wed, 14 Sep 2011 18:44:14 +0000
Subject: [MS_AccessPros] Record not deleting AARGH!!!


I know this must be a simple thing and it was working, but I've done some changing and now when I click the delete button on the Listings form it is not deleted.

I recently added a sub_Form based on ListingsHomeInfo table to the Listings form. It creates a one to many relationship between Listings and HomeInfo. The Listings table and ListingsHomeInfo table are in a cascade delete/update relationship. I do not think this could be the issue because even when I delete a Listing that has not entry in the ListingsHomeInfo table, it still does not delete.

Thanks sooo much!
Connie

The code for the delete button:

On Error GoTo Proc_Err

'if new record then beep
If (Me.NewRecord And Not Me.Dirty) Then
Beep
Exit Sub
End If
'if changes have been made, undo them
If Me.Dirty = True Then Me.Undo

'if not on a new record, then delete
If Not Me.NewRecord Then
DoCmd.RunCommand acCmdDeleteRecord
End If
Proc_Exit:
Exit Sub ' or Exit Function

Proc_Err:

Msgbox Err.Description, , _
"ERROR " & Err.Number _
& " btnDelete_Click"

Resume Proc_Exit

The RecordSource SQL:
SELECT qListings.*
FROM qListings
WHERE (((qListings.[CurrentListing])=-1));

SQL for qListings:
SELECT DISTINCTROW Listings.ListID, Listings.HomeInfoID, Listings.PropertyName, Listings.ListDate, Listings.ExpDate, Listings.ListingAgency, Listings.OriginalListPrice, Listings.OccupancyID, Listings.LockboxNbr, Listings.LotSize, Listings.ZoningID, Listings.HouseTypeID, Listings.Beds, Listings.baths, Listings.Fullbaths, Listings.ThreeQuarterBaths, Listings.Partialbaths, Listings.SquareFoot, Listings.Notes, HomeInfo.ParcelNbr, Listings.TelCombo, Listings.XtraInfo, Listings.YearBuilt, Listings.Rural, Listings.CurrentListing
FROM (HomeInfo INNER JOIN (Listings LEFT JOIN ListingContacts ON Listings.[ListID] = ListingContacts.[ListID]) ON HomeInfo.HomeInfoID = Listings.HomeInfoID) LEFT JOIN PotentialListings ON Listings.ListID = PotentialListings.ListID;


[Non-text portions of this message have been removed]

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MS_Access_Professionals/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)

<*> To change settings via email:
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
MS_Access_Professionals-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Tidak ada komentar:

Posting Komentar