The are written Below
Private Sub cmdadd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("sheet1")
'first find empty Row in the Sheet
iRow = ws.Cells.Find(what:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, SearchOrder:=xlValues).iRow + 1
'Check for a Name number
If Trim(Me.TextBox_ItemName.Value) = "" Then
Me.TextBox_ItemName.SetFocus
MsgBox "Please complete The Form"
Exit Sub
End If
'Copy the Data in the Database
ws.Cells(iRow, 1).Value = Me.TextBox_ItemName.Value
ws.Cells(iRow, 2).Value = Me.TextBox_DateIn.Value
ws.Cells(iRow, 3).Value = Me.TextBox_QtyIn.Value
ws.Cells(iRow, 4).Value = Me.TextBox_DateOut.Value
ws.Cells(iRow, 5).Value = Me.TextBox_QtyOut.Value
MsgBox "Data Added", vbOKOnly + vbInformation, "Data Added"
'Clear the Data
Me.TextBox_ItemName.Value = ""
Me.TextBox_DateIn.Value = ""
Me.TextBox_QtyIn.Value = ""
Me.TextBox_DateOut.Value = ""
Me.TextBox_QtyOut.Value = ""
Me.TextBox_ItemName.SetFocus
End Sub
Private Sub cmdclose_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
Private Sub cmdadd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("sheet1")
'first find empty Row in the Sheet
iRow = ws.Cells.Find(what:="*", SearchOrder:=xlRows, SearchDirection:=xlPrevious, SearchOrder:=xlValues).iRow + 1
'Check for a Name number
If Trim(Me.TextBox_ItemName.Value) = "" Then
Me.TextBox_ItemName.SetFocus
MsgBox "Please complete The Form"
Exit Sub
End If
'Copy the Data in the Database
ws.Cells(iRow, 1).Value = Me.TextBox_ItemName.Value
ws.Cells(iRow, 2).Value = Me.TextBox_DateIn.Value
ws.Cells(iRow, 3).Value = Me.TextBox_QtyIn.Value
ws.Cells(iRow, 4).Value = Me.TextBox_DateOut.Value
ws.Cells(iRow, 5).Value = Me.TextBox_QtyOut.Value
MsgBox "Data Added", vbOKOnly + vbInformation, "Data Added"
'Clear the Data
Me.TextBox_ItemName.Value = ""
Me.TextBox_DateIn.Value = ""
Me.TextBox_QtyIn.Value = ""
Me.TextBox_DateOut.Value = ""
Me.TextBox_QtyOut.Value = ""
Me.TextBox_ItemName.SetFocus
End Sub
Private Sub cmdclose_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub