title: ListBox Add Item
body: <p>Can someone help me? How to display the medicines in listbox if the stock quantity is less than 15 ?</p>
  
  <p>I tried this code but it's not working.</p>
  
  <pre><code>Private Sub List1_Click()
  If Text3.Text &lt;= 15 And Text3.Text &gt; 1 Then List1.AddItem Adodc1.Recordset("MedicineName")
  end sub
  </code></pre>
  
  <p>Seems my code is wrong. I don't know what to do next. Please help</p>
  
  <p>Here is my code in <strong>datagrid</strong> :</p>
  
  <pre><code>Private Sub DataGrid2_Click()
  With frm_ScrollUP1
  
   .Text3.Text = Adodc2.Recordset.Fields("StockQuantity")
    .Combo1.Text = Adodc2.Recordset.Fields("medicinename")
  If Text3.Text &lt; 0 Then
  MsgBox Combo1 &amp; " stock is not enough for the quantity you need!", vbExclamation, "   SORRY..."
  Text3.Text = ""
  Exit Sub
  End If
  
  If Text3.Text &lt;= 15 And Text3.Text &gt; 1 Then
  MsgBox "Please add more stocks of " &amp; Combo1 &amp; " !", vbExclamation, "   Warning!"
  ElseIf Text3.Text = 0 Then
  MsgBox Combo1 &amp; " is Empty!", vbCritical, "   Warning!"
  End If
  
  
  Combo1 = "Medicine Brand"
  Text2.Text = ""
  Text3.Text = ""
  Combo2 = "---MMMM----"
  Combo3 = "-DD-"
  Combo4 = "---YYYY---"
  Text2.Enabled = False
  End With
  
  end sub
  </code></pre>