Private mvarAcClass As Long

Private mvarAcCode As string


Private mvaraCcRdR As string


Private mvarAcFs As string


Private mvarAcLisName As string


Private mvarAcName As string


Public Property Let AcClass(ByVal vData As long)
         mvarAcClass= vData
End Property

Public Property Get AcClass() As long
        AcClass= mvarAcClass
End Property

Public Property Let AcCode(ByVal vData As String)
         mvarAcCode= vData
End Property

Public Property Get AcCode() As String
        AcCode= mvarAcCode
End Property

Public Property Let aCcRdR(ByVal vData As String)
         mvaraCcRdR= vData
End Property

Public Property Get aCcRdR() As String
        aCcRdR= mvaraCcRdR
End Property

Public Property Let AcFs(ByVal vData As String)
         mvarAcFs= vData
End Property

Public Property Get AcFs() As String
        AcFs= mvarAcFs
End Property

Public Property Let AcLisName(ByVal vData As String)
         mvarAcLisName= vData
End Property

Public Property Get AcLisName() As String
        AcLisName= mvarAcLisName
End Property

Public Property Let AcName(ByVal vData As String)
         mvarAcName= vData
End Property

Public Property Get AcName() As String
        AcName= mvarAcName
End Property



Function GetAc_Mst ( )
Dim S1 as string
Dim R1 as New Adodb.recordset
S1="Select * from Ac_Mst Where Ac_Code=" & AcCode
R1.open S1,con,adopendynamic,adlockoptimistic
    if not R1.eof then
     AcClass=R1!Ac_Class
     AcCode=R1!Ac_Code
     aCcRdR=R1!aC_cRdR
     AcFs=R1!Ac_Fs
     AcLisName=R1!Ac_LisName
     AcName=R1!Ac_Name

    End if
R1.close
End function




Function SaveAc_Mst (AddNew as Boolean)
Dim S1 as string
Dim R1 as New Adodb.recordset
    If Addnew=true then
         S1="Select Max(Ac_Code) from Ac_Mst"
         R1.open S1,con,adopendynamic,adlockoptimistic
              If  Not R1.eof then
                   AcCode=val(retfield(R1.fields(0)))+1
              End If
         R1.close
         S1="Select * from Ac_Mst"
    Else
         S1="Select * from Ac_Mst Where Ac_Code=" & AcCode
    End If
R1.open S1,con,adopendynamic,adlockoptimistic
   If Addnew=true then
      R1.addnew
   End If
     R1!Ac_Class = AcClass
     R1!Ac_Code = AcCode
     R1!aC_cRdR = aCcRdR
     R1!Ac_Fs = AcFs
     R1!Ac_LisName = AcLisName
     R1!Ac_Name = AcName

R1.update
R1.close
Msgbox "Saved Succesfully"

End function
