J
Jennifer
Hi Tom,
Thank you for your advice. I am not sure what is happening or if I placed
your code correctly but the form comes up but the listbox is no longer filled
when the user makes a choice from the combo box (cmbgrower) The following
shows you how I placed your code. Sorry but I need more help.
Private Sub LoadData()
If grower = source.Cells(index, 4) And _
source.Cells(index, 3) >= CDate(dtStart.Value) And _
source.Cells(index, 3) <= CDate(dtFinish.Value) Then
With lstData
.Clear
grower = cbogrower.Value
For index = 2 To source.Rows.Count
If grower = source.Cells(index, 4) Then
.AddItem source.Cells(index, 1) ' ID
.List(.ListCount - 1, 2) = source.Cells(index,
eBoxes.ProduceItem) 'Date
.List(.ListCount - 1, 3) = source.Cells(index,
eBoxes.BoxesPurchased) ' Fruit
.List(.ListCount - 1, 4) = source.Cells(index, eBoxes.Date)
'Boxes
.List(.ListCount - 1, 5) = source.Cells(index, eBoxes.Inv)
'Boxes
.List(.ListCount - 1, 6) = source.Cells(index,
eBoxes.GrossPrice) 'Boxes
.List(.ListCount - 1, 7) = source.Cells(index, eBoxes.Frt)
'Boxes
' .List(.ListCount - 1, 8) = source.Cells(index,
eBoxes.NetGross) 'Boxes
' .List(.ListCount - 1, 9) = source.Cells(index,
eBoxes.FormID) 'Boxes
End If
Next
End With
End If
End If
End Sub
Thank you for your advice. I am not sure what is happening or if I placed
your code correctly but the form comes up but the listbox is no longer filled
when the user makes a choice from the combo box (cmbgrower) The following
shows you how I placed your code. Sorry but I need more help.
Private Sub LoadData()
If grower = source.Cells(index, 4) And _
source.Cells(index, 3) >= CDate(dtStart.Value) And _
source.Cells(index, 3) <= CDate(dtFinish.Value) Then
With lstData
.Clear
grower = cbogrower.Value
For index = 2 To source.Rows.Count
If grower = source.Cells(index, 4) Then
.AddItem source.Cells(index, 1) ' ID
.List(.ListCount - 1, 2) = source.Cells(index,
eBoxes.ProduceItem) 'Date
.List(.ListCount - 1, 3) = source.Cells(index,
eBoxes.BoxesPurchased) ' Fruit
.List(.ListCount - 1, 4) = source.Cells(index, eBoxes.Date)
'Boxes
.List(.ListCount - 1, 5) = source.Cells(index, eBoxes.Inv)
'Boxes
.List(.ListCount - 1, 6) = source.Cells(index,
eBoxes.GrossPrice) 'Boxes
.List(.ListCount - 1, 7) = source.Cells(index, eBoxes.Frt)
'Boxes
' .List(.ListCount - 1, 8) = source.Cells(index,
eBoxes.NetGross) 'Boxes
' .List(.ListCount - 1, 9) = source.Cells(index,
eBoxes.FormID) 'Boxes
End If
Next
End With
End If
End If
End Sub