ProgrammingIdiot
Member
- Joined
- Apr 15, 2013
- Messages
- 9
- Programming Experience
- Beginner
Hi , i am currently designing a Inventory Management System for my school Project , the add data edit data and delete data part of the software works for me but i am kinda stuck at the filtering data part and it does not seem to work at all . This is my source Code
P.s I am really new to programming , i just started learning the language 4 weeks ago , sometimes i might not know what i am coding
Sub combobox_itemID() Dim rs = New ADODB.Recordset With rs .Open("Select ItemID from Inventory", cn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic) ComboBox1.Items.Clear() .MoveFirst() While Not .EOF ComboBox1.Items.Add(.Fields(0).Value) .MoveNext() End While ComboBox1.Text = ComboBox1.Items(0) End With End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged MessageBox.Show("Select Item ID - " & ComboBox1.Text) Dim lst Dim rs = New ADODB.Recordset ListView1.Items.Clear() With rs .Open("select t.ItemID,t.ItemName,t.ItemDescription,t.Quantity,t.Unit,t.Location,t.Cost,t.Status,t.DateReceived,t.Packed* from Inventory t,Warehouse s where t.ItemID=s.ItemID and s.ItemName='" & ComboBox1.Text & "'", cn, 2, 3) Do While Not .EOF lst = New ListViewItem lst = ListView1.Items.Add(.Fields(0).Value) lst.SubItems.Add(.Fields(1).Value) lst.SubItems.Add(.Fields(2).Value) lst.SubItems.Add(.Fields(3).Value) lst.SubItems.Add(.Fields(4).Value) lst.SubItems.Add(.Fields(5).Value) lst.SubItems.Add(.Fields(6).Value) lst.SubItems.Add(.Fields(7).Value) lst.SubItems.Add(.Fields(8).Value) lst.SubItems.Add(.Fields(9).Value) .MoveNext() Loop End With End Sub
P.s I am really new to programming , i just started learning the language 4 weeks ago , sometimes i might not know what i am coding