Saturday, 8 January 2022

MS Excel UserForm Save and Edit Button Part-2 Module

    HOME PAGE      

UPSC :-UPSC Prelims 2021 Paper Analysis I Indian Polity             UPSC Prelims 2021 Paper Analysis I Science & Technology                 UPSC Prelims 2021 Paper Analysis I Geography             IAS/PCS Essay Book  Paper Notice and syllabus :PET EXAMINATION SYLLABUS            PET QUESTION PAPER                 SINDHU GHATI SABHYATA                         GST                     B.Ed Second Year Book -2021                            DIGITAL INDIA                    CHILD LABOUR IN INDIA  Competitive Book :- GK/GS Book 2021                              All Competitive Maths Book                    All Competitive Resigning Book            Important Project :-Visual Studio C # Project      Tally Erp9 Account Feature      Microsoft  Excel VBA Project                    who to  apply mathematical Formula in ms excel user form                   MS Excel UserForm Save And Edit Button Part-1 Module          MS Excel UserForm Save And Edit Button Part-2 Module



 1) Save Button Module :-

                                          Let :-  Module

TextBox change Module 

II) Edit Button Module :-

                                         Let :-

                                     MS Excel Work Sheet Name Sale

                                     TextBox1Me.TextBoxPos_Entry_Id

                                     CommandButton1 CommandButtonPosEntryEdit

                                      ListBox1 =  ListBoxPos_Entry_Detail

                                      TextBox1 =   Me.TextBoxPos_Entry_Barcode1

                                     TextBox2 =    Me.TextBoxPos_Entry_Qty1

                                    TextBox3 =      Me.TextBoxPos_Entry_Rate1

                                    TextBox4 =       Me.TextBoxPos_Entry_Discount_Percentage1

                                    TextBox5 =      Me.TextBoxPos_Entry_Discount1

                                    TextBox6 =      Me.TextBoxPos_Entry_Taxtable_Value1

                                    TextBox7 =      Me.TextBoxPos_Entry_Amount1

                                     TextBox8 =     Me.TextBoxPos_Entry_Sales_Man1

Private Sub CommandButtonPosEntryEdit_Click()


'''''''''''validation'''''''''''

 If Me.TextBoxPos_Entry_Barcode1.Value = "" Then

      msgbox "Please Enter the Product Name", vbCritical

      Exit Sub

 End If

 

 If IsNumeric(Me.TextBoxPos_Entry_Qty1.Value) = False Then

     msgbox "Please Enter the Correct Purchase Price", vbCritical

     Exit Sub

End If


If IsNumeric(Me.TextBoxPos_Entry_Rate1.Value) = False Then

     msgbox "Please Enter the Correct Sale Price", vbCritical

     Exit Sub

End If


Dim sh As Worksheet

Set sh = ThisWorkbook.Sheets("Sale")



 

 ''''''''''''Update Data

 Dim lr As Integer

 

 lr = Me.TextBoxPos_Entry_Id.Value

 

 sh.Range("A" & lr + 1).Value = lr

 sh.Range("B" & lr + 1).Value = Me.TextBoxPos_Entry_Barcode1.Value

 sh.Range("C" & lr + 1).Value = Me.TextBoxPos_Entry_Qty1.Value

 sh.Range("D" & lr + 1).Value = Me.TextBoxPos_Entry_Rate1.Value

 sh.Range("E" & lr + 1).Value = Me.TextBoxPos_Entry_Discount_Percentage1.Value

 sh.Range("F" & lr + 1).Value = Me.TextBoxPos_Entry_Discount1.Value

 sh.Range("G" & lr + 1).Value = Me.TextBoxPos_Entry_Taxtable_Value1.Value

 sh.Range("H" & lr + 1).Value = Me.TextBoxPos_Entry_Amount1.Value

 sh.Range("I" & lr + 1).Value = Me.TextBoxPos_Entry_Sales_Man1.Value


 

 

 ''''''''''Clear Boxes

  Me.TextBoxPos_Entry_Barcode1.Value = ""

  Me.TextBoxPos_Entry_Qty1.Value = ""

  Me.TextBoxPos_Entry_Rate1.Value = ""

  Me.TextBoxPos_Entry_Discount_Percentage1.Value = ""

  Me.TextBoxPos_Entry_Discount1.Value = "" 

  Me.TextBoxPos_Entry_Taxtable_Value1.Value = ""

  Me.TextBoxPos_Entry_Amount1.Value = ""

  Me.TextBoxPos_Entry_Sales_Man1.Value = ""


 Call Show_Data

 

 

 msgbox "Product has been Updated in Product Master", vbInformation


End Sub




Private Sub ListBoxPos_Entry_Detail_(ByVal Cancel As MSForms.ReturnBoolean)

     Me.TextBoxPos_Entry_Id.Value = Me.ListBoxPos_Entry_Detail.List(Me.ListBoxPos_Entry_Detail.ListIndex, 0)
 
    Me.TextBoxPos_Entry_Barcode1.Value  =Me.ListBoxPos_Entry_Detail.List(Me.ListBoxPos_Entry_Detail.ListIndex, 1) 
 
  Me.TextBoxPos_Entry_Qty1.Value = Me.ListBoxPos_Entry_Detail.List(Me.ListBoxPos_Entry_Detail.ListIndex, 2)
 
    Me.TextBoxPos_Entry_Rate1.Value  = Me.ListBoxPos_Entry_Detail.List(Me.ListBoxPos_Entry_Detail.ListIndex, 3)

 Me.TextBoxPos_Entry_Discount_Percentage1.Value = Me.ListBoxPos_Entry_Detail.List(Me.ListBoxPos_Entry_Detail.ListIndex, 4) 
 
  Me.TextBoxPos_Entry_Discount1.Value  = Me.ListBoxPos_Entry_Detail.List(Me.ListBoxPos_Entry_Detail.ListIndex, 5)
 
  Me.TextBoxPos_Entry_Taxtable_Value1.Value  = Me.ListBoxPos_Entry_Detail.List(Me.ListBoxPos_Entry_Detail.ListIndex, 6)

   Me.TextBoxPos_Entry_Amount1.Value  = Me.ListBoxPos_Entry_Detail.List(Me.ListBoxPos_Entry_Detail.ListIndex, 7)
   
    Me.TextBoxPos_Entry_Sales_Man1.Value = Me.ListBoxPos_Entry_Detail.List(Me.ListBoxPos_Entry_Detail.ListIndex, 8)



End Sub



Some other topics:- 










No comments:

Post a Comment

Synthesis process of thiol || Advance organic synthesis Method

  Synthesis process of thiol (RSH): -   Synthesis process of thiol (RSH):-                                                                In...