home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 February / PCWK0297.iso / lotus / english / lotus036.dsk / AMORTIZE.MPR / SCRIPT / ApproachDoc / Amortization / Body / butDeleteAmort.s (.txt) < prev    next >
Null Bytes Alternating  |  1995-11-12  |  3KB  |  43 lines

  1. '++LotusScript Development Environment:2:5:(Options):0:66
  2.  
  3. '++LotusScript Development Environment:2:5:(Forward):0:1
  4. Declare Sub Click(Source As Button, X As Long, Y As Long, Flags As Long)
  5.  
  6. '++LotusScript Development Environment:2:5:(Declarations):0:2
  7.  
  8. '++LotusScript Development Environment:2:2:BindEvents:1:129
  9. Private Sub BindEvents(Byval Objectname_ As String)
  10.     Static Source As BUTTON
  11.     Set Source = Bind(Objectname_)
  12.     On Event Click From Source Call Click
  13. End Sub
  14.  
  15. '++LotusScript Development Environment:2:2:Click:1:12
  16. Sub Click(Source As Button, X As Long, Y As Long, Flags As Long)
  17.     Dim Con As New connection
  18.     Dim QryPayment As New query
  19.     Dim RsPayment As New resultset
  20.     LoanNumberVariable=source.loan_no.text
  21.     If Con.connectto ("dbase IV") Then
  22.         Set QryPayment.connection=con
  23.         QryPayment.tablename=currentdocument.path+"payment.dbf"
  24.         QryPayment.sql="select * from """+QryPayment.tablename+""""+" WHERE Loan_no = "+LoanNumberVariable
  25.         Set RsPayment.query=QryPayment
  26.     End If
  27.     If (RsPayment.execute) Then
  28.         Dim boxType As Long, answer As Integer
  29.         boxType=MB_OKCANCEL+ MBICONQUESTION
  30.         answer=Messagebox("Click OK to delete "+Cstr(RsPayment.numrows)+" records",boxtype,"Continue?")
  31.         deletemessage
  32.         currentwindow.repaint
  33.         If answer=1 Then
  34.             For i=1 To RsPayment.numrows
  35.                 RsPayment.deleterow
  36.                 RsPayment.updaterow
  37.             Next i
  38.             Set a=source.txtDelMessage
  39.             Delete a
  40.         End If
  41.     End If
  42.     currentapplication.applicationwindow.domenucommand(IDM_Refresh)
  43. End Sub