Private mvarDsClAcCd As string


Private mvarDsDate As Date

Private mvarDsDisAmt As Double

Private mvarDsDisPer As Double


Private mvarDsGross As Double

Private mvarDsInvNo As string


Private mvarDsItCd As Long

Private mvarDsItName As string


Private mvarDsQty As Double

Private mvarDsRate As Double

Private mvarDsRefNo As Long

Private mvarDsSlNo As Integer

Private mvarDstax As Double

Private mvarDsTaxPer As Double

Public Property Let DsClAcCd(ByVal vData As String)
         mvarDsClAcCd= vData
End Property

Public Property Get DsClAcCd() As String
        DsClAcCd= mvarDsClAcCd
End Property

Public Property Let DsDate(ByVal vData As Date)
         mvarDsDate= vData
End Property

Public Property Get DsDate() As Date
        DsDate= mvarDsDate
End Property

Public Property Let DsDisAmt(ByVal vData As Double)
         mvarDsDisAmt= vData
End Property

Public Property Get DsDisAmt() As Double
        DsDisAmt= mvarDsDisAmt
End Property

Public Property Let DsDisPer(ByVal vData As Double)
         mvarDsDisPer= vData
End Property

Public Property Get DsDisPer() As Double
        DsDisPer= mvarDsDisPer
End Property

Public Property Let DsGross(ByVal vData As Double)
         mvarDsGross= vData
End Property

Public Property Get DsGross() As Double
        DsGross= mvarDsGross
End Property

Public Property Let DsInvNo(ByVal vData As String)
         mvarDsInvNo= vData
End Property

Public Property Get DsInvNo() As String
        DsInvNo= mvarDsInvNo
End Property

Public Property Let DsItCd(ByVal vData As long)
         mvarDsItCd= vData
End Property

Public Property Get DsItCd() As long
        DsItCd= mvarDsItCd
End Property

Public Property Let DsItName(ByVal vData As String)
         mvarDsItName= vData
End Property

Public Property Get DsItName() As String
        DsItName= mvarDsItName
End Property

Public Property Let DsQty(ByVal vData As Double)
         mvarDsQty= vData
End Property

Public Property Get DsQty() As Double
        DsQty= mvarDsQty
End Property

Public Property Let DsRate(ByVal vData As Double)
         mvarDsRate= vData
End Property

Public Property Get DsRate() As Double
        DsRate= mvarDsRate
End Property

Public Property Let DsRefNo(ByVal vData As long)
         mvarDsRefNo= vData
End Property

Public Property Get DsRefNo() As long
        DsRefNo= mvarDsRefNo
End Property

Public Property Let DsSlNo(ByVal vData As integer)
         mvarDsSlNo= vData
End Property

Public Property Get DsSlNo() As integer
        DsSlNo= mvarDsSlNo
End Property

Public Property Let Dstax(ByVal vData As Double)
         mvarDstax= vData
End Property

Public Property Get Dstax() As Double
        Dstax= mvarDstax
End Property

Public Property Let DsTaxPer(ByVal vData As Double)
         mvarDsTaxPer= vData
End Property

Public Property Get DsTaxPer() As Double
        DsTaxPer= mvarDsTaxPer
End Property



Function GetDmg_sub ( )
Dim S1 as string
Dim R1 as New Adodb.recordset
S1="Select * from Dmg_sub Where Ds=" & Ds
R1.open S1,con,adopendynamic,adlockoptimistic
    if not R1.eof then
     DsClAcCd=R1!Ds_ClAcCd
     DsDate=R1!Ds_Date
     DsDisAmt=R1!Ds_DisAmt
     DsDisPer=R1!Ds_DisPer
     DsGross=R1!Ds_Gross
     DsInvNo=R1!Ds_InvNo
     DsItCd=R1!Ds_ItCd
     DsItName=R1!Ds_ItName
     DsQty=R1!Ds_Qty
     DsRate=R1!Ds_Rate
     DsRefNo=R1!Ds_RefNo
     DsSlNo=R1!Ds_SlNo
     Dstax=R1!Ds_tax
     DsTaxPer=R1!Ds_TaxPer

    End if
R1.close
End function




Function SaveDmg_sub (AddNew as Boolean)
Dim S1 as string
Dim R1 as New Adodb.recordset
    If Addnew=true then
         S1="Select Max(Ds) from Dmg_sub"
         R1.open S1,con,adopendynamic,adlockoptimistic
              If  Not R1.eof then
                   Ds=val(retfield(R1.fields(0)))+1
              End If
         R1.close
         S1="Select * from Dmg_sub"
    Else
         S1="Select * from Dmg_sub Where Ds=" & Ds
    End If
R1.open S1,con,adopendynamic,adlockoptimistic
   If Addnew=true then
      R1.addnew
   End If
     R1!Ds_ClAcCd = DsClAcCd
     R1!Ds_Date = DsDate
     R1!Ds_DisAmt = DsDisAmt
     R1!Ds_DisPer = DsDisPer
     R1!Ds_Gross = DsGross
     R1!Ds_InvNo = DsInvNo
     R1!Ds_ItCd = DsItCd
     R1!Ds_ItName = DsItName
     R1!Ds_Qty = DsQty
     R1!Ds_Rate = DsRate
     R1!Ds_RefNo = DsRefNo
     R1!Ds_SlNo = DsSlNo
     R1!Ds_tax = Dstax
     R1!Ds_TaxPer = DsTaxPer

R1.update
R1.close
Msgbox "Saved Succesfully"

End function
