Simple, but I don't see it

G

Guest

This is probably so easy, but I don't see what is wrong. Everything works
great except for the line were i put **** isn't showing up in the database.
It leaves it blank. The combo box works great. Help!

Private Sub cmdAddWaste_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Database")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'check for a date
If Trim(Me.txtD.Value) = "" Then
Me.txtDate.SetFocus
MsgBox "Please enter a Date"
Exit Sub
End If

'copy the data to the database
ws.Cells(iRow, 1).Value = "=R[-1]C+1"
ws.Cells(iRow, 2).Value = Me.txtD.Value
ws.Cells(iRow, 3).Value = Me.cboProduceItem.Value ***********
ws.Cells(iRow, 4).Value = "0"
ws.Cells(iRow, 5).Value = "0"
ws.Cells(iRow, 6).Value = Me.txtBxsWaste.Value
ws.Cells(iRow, 7).Value = Me.txtWeight.Value
ws.Cells(iRow, 8).Value = Me.txtPrice.Value
ws.Cells(iRow, 9).Value = "None"
ws.Cells(iRow, 10).Value = "Waste"

'select a cold storage
If Me.OptionButton3.Value Then
ws.Cells(iRow, 11).Value = Me.OptionButton3.Caption
Else
ws.Cells(iRow, 11).Value = Me.OptionButton4.Caption
End If

'clear the data
Me.cboProduceItem.Value = ""
Me.txtBxsWaste.Value = ""
Me.txtD.Value = Format(Date, "Medium Date")
Me.txtWeight.Value = ""
Me.cboProduceItem.SetFocus
Me.txtPrice.Value = ""

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top