trouble where it says if trim(txtcirculation) ="" ???
win 7 excel 2007
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("star")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.txtcirculation.Value) = "" Then
Me.txtcirculation.SetFocus
MsgBox "Please enter Quantiy"""
Exit Sub
End If
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.txt010104.Value
ws.Cells(iRow, 2).Value = Me.txt010105.Value
ws.Cells(iRow, 3).Value = Me.txt010106.Value
ws.Cells(iRow, 4).Value = Me.txt010107.Value
ws.Cells(iRow, 5).Value = Me.txt010108.Value
ws.Cells(iRow, 6).Value = Me.txt010109.Value
ws.Cells(iRow, 7).Value = Me.txt010110.Value
ws.Cells(iRow, 8).Value = Me.txt044201.Value
ws.Cells(iRow, 9).Value = Me.txt044202.Value
ws.Cells(iRow, 10).Value = Me.txt044203.Value
ws.Cells(iRow, 11).Value = Me.txt044204.Value
ws.Cells(iRow, 12).Value = Me.txt044205.Value
ws.Cells(iRow, 13).Value = Me.txt044206.Value
ws.Cells(iRow, 14).Value = Me.txt078501.Value
ws.Cells(iRow, 15).Value = Me.txt078502.Value
ws.Cells(iRow, 16).Value = Me.txt078503.Value
ws.Cells(iRow, 17).Value = Me.txt078504.Value
ws.Cells(iRow, 18).Value = Me.txt078505.Value
ws.Cells(iRow, 19).Value = Me.txt078506.Value
ws.Cells(iRow, 20).Value = Me.txt078508.Value
ws.Cells(iRow, 21).Value = Me.txt078509.Value
ws.Cells(iRow, 22).Value = Me.txt086001.Value
ws.Cells(iRow, 23).Value = Me.txt086003.Value
ws.Cells(iRow, 24).Value = Me.txt086004.Value
ws.Cells(iRow, 25).Value = Me.txt086006.Value
ws.Cells(iRow, 26).Value = Me.txt086011.Value
ws.Cells(iRow, 27).Value = Me.txt000001.Value
ws.Cells(iRow, 28).Value = Me.txt000002.Value
ws.Cells(iRow, 29).Value = Me.txt000003.Value
ws.Cells(iRow, 30).Value = Me.txt000004.Value
ws.Cells(iRow, 31).Value = Me.txt000005.Value
'clear the data
Me.txt010104.Value = ""
Me.txt010105.Value = ""
Me.txt010106.Value = ""
Me.txt010107.Value = ""
Me.txt010108.Value = ""
Me.txt010109.Value = ""
Me.txt010110.Value = ""
Me.txt044201.Value = ""
Me.txt044202.Value = ""
Me.txt044203.Value = ""
Me.txt044204.Value = ""
Me.txt044205.Value = ""
Me.txt044206.Value = ""
Me.txt078501.Value = ""
Me.txt078502.Value = ""
Me.txt078503.Value = ""
Me.txt078504.Value = ""
Me.txt078505.Value = ""
Me.txt078506.Value = ""
Me.txt078508.Value = ""
Me.txt078509.Value = ""
Me.txt086001.Value = ""
Me.txt086003.Value = ""
Me.txt086004.Value = ""
Me.txt086006.Value = ""
Me.txt086011.Value = ""
Me.txt000001.Value = ""
Me.txt000002.Value = ""
Me.txt000003.Value = ""
Me.txt000004.Value = ""
Me.txt000005.Value = ""
Me.txtcarriername.SetFocus
End Sub
Private Sub cmdclose_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
win 7 excel 2007
Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("star")
'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
'check for a part number
If Trim(Me.txtcirculation.Value) = "" Then
Me.txtcirculation.SetFocus
MsgBox "Please enter Quantiy"""
Exit Sub
End If
'copy the data to the database
ws.Cells(iRow, 1).Value = Me.txt010104.Value
ws.Cells(iRow, 2).Value = Me.txt010105.Value
ws.Cells(iRow, 3).Value = Me.txt010106.Value
ws.Cells(iRow, 4).Value = Me.txt010107.Value
ws.Cells(iRow, 5).Value = Me.txt010108.Value
ws.Cells(iRow, 6).Value = Me.txt010109.Value
ws.Cells(iRow, 7).Value = Me.txt010110.Value
ws.Cells(iRow, 8).Value = Me.txt044201.Value
ws.Cells(iRow, 9).Value = Me.txt044202.Value
ws.Cells(iRow, 10).Value = Me.txt044203.Value
ws.Cells(iRow, 11).Value = Me.txt044204.Value
ws.Cells(iRow, 12).Value = Me.txt044205.Value
ws.Cells(iRow, 13).Value = Me.txt044206.Value
ws.Cells(iRow, 14).Value = Me.txt078501.Value
ws.Cells(iRow, 15).Value = Me.txt078502.Value
ws.Cells(iRow, 16).Value = Me.txt078503.Value
ws.Cells(iRow, 17).Value = Me.txt078504.Value
ws.Cells(iRow, 18).Value = Me.txt078505.Value
ws.Cells(iRow, 19).Value = Me.txt078506.Value
ws.Cells(iRow, 20).Value = Me.txt078508.Value
ws.Cells(iRow, 21).Value = Me.txt078509.Value
ws.Cells(iRow, 22).Value = Me.txt086001.Value
ws.Cells(iRow, 23).Value = Me.txt086003.Value
ws.Cells(iRow, 24).Value = Me.txt086004.Value
ws.Cells(iRow, 25).Value = Me.txt086006.Value
ws.Cells(iRow, 26).Value = Me.txt086011.Value
ws.Cells(iRow, 27).Value = Me.txt000001.Value
ws.Cells(iRow, 28).Value = Me.txt000002.Value
ws.Cells(iRow, 29).Value = Me.txt000003.Value
ws.Cells(iRow, 30).Value = Me.txt000004.Value
ws.Cells(iRow, 31).Value = Me.txt000005.Value
'clear the data
Me.txt010104.Value = ""
Me.txt010105.Value = ""
Me.txt010106.Value = ""
Me.txt010107.Value = ""
Me.txt010108.Value = ""
Me.txt010109.Value = ""
Me.txt010110.Value = ""
Me.txt044201.Value = ""
Me.txt044202.Value = ""
Me.txt044203.Value = ""
Me.txt044204.Value = ""
Me.txt044205.Value = ""
Me.txt044206.Value = ""
Me.txt078501.Value = ""
Me.txt078502.Value = ""
Me.txt078503.Value = ""
Me.txt078504.Value = ""
Me.txt078505.Value = ""
Me.txt078506.Value = ""
Me.txt078508.Value = ""
Me.txt078509.Value = ""
Me.txt086001.Value = ""
Me.txt086003.Value = ""
Me.txt086004.Value = ""
Me.txt086006.Value = ""
Me.txt086011.Value = ""
Me.txt000001.Value = ""
Me.txt000002.Value = ""
Me.txt000003.Value = ""
Me.txt000004.Value = ""
Me.txt000005.Value = ""
Me.txtcarriername.SetFocus
End Sub
Private Sub cmdclose_Click()
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub