Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - ADO General
Forum to discuss ADO specific questions for use with SalesLogix. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to ADO General | New ThreadView:  Search:  
 Author  Thread: Deleting one record from a grid
David Nunnally
Posts: 206
 
Deleting one record from a gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Nov 06 10:06 AM
fiogf49gjkf0d
When I use the below script it deletes all records in the grid. What am I doing wrong here? I just need to delete the one that is selected. These are not yet saved in the database.

With grdGuests.Recordset
If Not (.BOF And .EOF) Then
.MoveFirst
For i = 0 To .RecordCount - 1
If .Fields("KEYFIELDID").Value = strKeyFieldID Then
.Delete
End If
.MoveNext
Next
End If
End With
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Deleting one record from a gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Nov 06 10:28 AM
fiogf49gjkf0d
Hi David,

If these are not yet saved in the database then does the KEYFIELDID field really have a value? Maybe it is blank causing the IF block to be true for all records? That is the only thing I can come up with that would make sense.

-Ryan
[Reply][Quote]
David Nunnally
Posts: 206
 
Re: Deleting one record from a gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Nov 06 10:33 AM
fiogf49gjkf0d
Yes, I am assigning the keyfieldid when adding the record to the grid. Maybe my problem is not that it is deleting all records but maybe the gridrs is not getting updated correctly. I will kick it a few more times.
[Reply][Quote]
David Nunnally
Posts: 206
 
Re: Deleting one record from a gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Nov 06 1:29 PM
fiogf49gjkf0d
I was barking up the wrong tree. It was not my deletion script causing the problem. Found my issue by adding some message boxes to walk thru the firing order. A lot of events were firing and one of them called the griddefinition routine that of course wiped it out. I tweaked the events to correclty handle this.

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/22/2024 10:40:24 AM