Sub Main ()
With MetaScript
.EXEC " uPDATE product set hsn='3004' where hsn is null or hsn=''", .getdatafile

   .showform "select 0 as se, hsn as HSN,COUNT(*) AS pRODS, hsn AS HKEY  from product as p  where LEN(HSN)<8 AND hide = 0 GROUP BY HSN order by P.HSN",.getdatafile, p1, p2, TRUE
   if trim(p1) = "" then msgbox "Please Select Product First",vbinformation,"PharmaPulse" : Exit sub
   
   hsn = inputbox("Please Enter Your HSN Codes Here","Enter Valid HSN Code","")
   
   if msgbox ("Are you sure want to confirm action ?.",Vbyesno + vbdefaultbutton2 + vbinformation,"PharmaPulse") = vbyes then
      if trim(p1) <> "" then  .exec "Update Product Set HSN  = '" & hsn & "' where HSN in ( " & p1 & ") ",.getdatafile else Msgbox "Invalid Object",vbcritical,"PharmaPulse"  : Exit sub
   end if 
   msgbox "GST HSN Codes Updated",vbinformation,"PharmaPulse"
End With
End Sub



