Paradox Community

Items in pnews.paradox-web

Subject:New request
Date:Thu, 11 Aug 2016 16:09:52 -0700
From:JI <products@consoftolnline.com>
Newsgroups:pnews.paradox-web
I've generated a table from the database.  One of the fields is a 
checkbox named 'Delete'.  The following code finds the line in which the 
box is checked but I can't get the values of the fields on the line so I 
can delete the record.



 >     case upper(thebuttonpressed) = "DELETE APPOINTMENT" :
 >         jij_lib.getTheUser()
 >
 >         tcEvents.open(":REPCHKDATA:Events.db")
 >
 >         for I from 1 to thecount
 >             thecheckbox= "c" + string(I)
 >
 >             try
 >                 theCurrentCheckBox = Request.GetField(thecheckbox)
 >             onFail
 >              Response.resultstring = jij_lib.createAMessage( 
"\"Cannot get the checkbox ID. \"")
 >              return
 >             endtry
 >
 >             if theCurrentCheckBox = "Delete" then
 >                 tcEvents.edit()
 >                 theFacilityName = request.getfield("Facility")
 >                 theProviderName = request.getfield("Provider")
 >                 theAppointmentDate = request.getfield("Date")
 >
 >                 try
 >                     tcEvents.locate(
 >                          "ProviderName",theProviderName,
 >                          "Name",theUser,
 >                          "FacilityName",theFacilityName,
 >                          "Event_Next",theAppointmentDate)
 >                     tcEvents.deleterecord()
 >                 onfail
 >                     Response.resultstring = jij_lib.createAMessage( 
"\"Cannot find this record. \"")
 >                     return
 >                 endtry
 >
 >             endif
 >         endfor
 >         tcEvents.close()
 >         Response.resultstring = jij_lib.createAMessage( "\"You 
Deleted a record! Press the REFRESH key. \"")
 >         return

         for I from 1 to thecount
             thecheckbox= "c" + string(I)

             try
                 theCurrentCheckBox = Request.GetField(thecheckbox)
             onFail
              Response.resultstring = jij_lib.createAMessage( "\"Cannot 
get the checkbox ID. \"")
              return
             endtry

             if theCurrentCheckBox = "Delete" then
                 tcEvents.edit()
                 theFacilityName = request.getfield("Facility")
                 theProviderName = request.getfield("Provider")
                 theAppointmentDate = request.getfield("Date")

                 try
                     tcEvents.locate(
                          "ProviderName",theProviderName,
                          "Name",theUser,
                          "FacilityName",theFacilityName,
                          "Event_Next",theAppointmentDate)
                     tcEvents.deleterecord()
                 onfail
                     Response.resultstring = jij_lib.createAMessage( 
"\"Cannot find this record. \"")
                     return
                 endtry

             endif
         endfor
         tcEvents.close()
         Response.resultstring = jij_lib.createAMessage( "\"You Deleted 
a record! Press the REFRESH key. \"")
         return


Copyright © 2004 thedbcommunity.com