Rabu, 14 September 2011

[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;

__._,_.___
Recent Activity:
MARKETPLACE
A bad score is 579. A good idea is checking yours at freecreditscore.com.

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar