Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete from grid
Message
 
 
To
01/10/1999 16:50:39
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00271773
Message ID:
00271781
Views:
24
>I have got weird problem while deleting records from grid. I have two pages in the pageframe and page1 contains grid which has recordsource type as select statement.when I invoke the delete function while page 1 is up every thing works fine.If I do the same thing when page 2 is up, it gives me an error message "no table is open in current work area". Did Anybody see this error before.What causes this error.
>
>Thanx
>Gnana.

Are you using the Delete column of the grid to delete records? If so, this is what I have in my grid baseclass Delete method:
LPARAMETERS nRecNo
local lcRecordSource, lnSelect
lcRecordSource = This.RecordSource
lnSelect = select()
select (lcRecordSource)
with This
   if .RecordSourceType < 2
      goto record nRecNo
      .SetFocus()
      .Parent.Refresh()
      if .lWarning    && custom property of the grid
         local lnRetVal, lcMessage
         lcMessage = "Are you sure you want to delete the record?"
         lnRetval = MessageBox(lcMessage, MB_ICONSTOP + MB_YESNO ;
                  + MB_DEFBUTTON2, "WARNING")
         if lnRetVal <> IDYES
            NoDefault
            select (lnSelect)
            return 0
         endif
      endif
      delete next 1
      skip -1
      if bof()
         locate
      endif
      .Refresh()
   endif
endwith
NoDefault
select (lnSelect)
Return
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform