Save Button Module :-
Fist Create a table in ms excel user form . And Set all the Text Boxes Properties.
as like instruction . In this module fist three line is the module of massage. Next of line in this program is set the Text box filling check up .
The Next process is that Add the data in the ms excel data sheets. if the data is complete Adding process then the massage box is open . Click the yes Button in the massage box Data is Add successfully.
User Form Text boxes properties is write below.
1) Save Button Module :-
Let :-
MS Excel Table Sheet Name = Sale
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 CommandButtonPos_Entry_Save_Click()
Dim MsgValue As VbMsgBoxResult
MsgValue = MsgBox("Do You Want to save the Date?", vbYesNo + vbInformation, "Confirmation")
If MsgValue = vbNo Then Exit Sub
'''''''''''validation'''''''''''
If Me.TextBoxPos_Entry_Barcode1.Value = "" Then
MsgBox "Please Enter the Barcede", vbCritical
Exit Sub
End If
If IsNumeric(Me.TextBoxPos_Entry_Qty1.Value) = False Then
MsgBox "Please Enter the Wright Qty", vbCritical
Exit Sub
End If
If IsNumeric(Me.TextBoxPos_Entry_Rate1.Value) = False Then
MsgBox "Please Enter the wright Rate", vbCritical
Exit Sub
End If
''''''''''''Add Data
Dim lr As Integer
Set sh = ThisWorkbook.Sheets("Sale")
''1
lr = Application.WorksheetFunction.CountA(sh.Range("A:A"))
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
'''''''item Clear
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 added in Product Master", vbInformation
End Sub
Sub Show_Data()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Sale")
Dim lr As Integer
lr = Application.WorksheetFunction.CountA(sh.Range("A:A"))
If lr = 1 Then lr = 2
With Me.ListBoxPos_Entry_Detail
.ColumnCount = 9
.ColumnHeads = True
.ColumnWidths = "100,130,130,100,100,100,100,100,100"
.RowSource = "Sale!A2:I" & lr
End With
End Sub
2) Edit Button Module :-
Let :- Module
Some other topics:-
No comments:
Post a Comment