somthing wrong help

red95

Board Regular
Joined
Jan 4, 2009
Messages
141
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
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,224,560
Messages
6,179,520
Members
452,923
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top