i have been geeking away with my stock control system i am creating and have incountered a problem.
Basically it pops up the message Recordset does not support scrolling backwards with this code.
my stock goes down everytime someone buys something and when it reaches 0 i got a form which displays which items are out of stock...and this form is where ive got the problem. Any ideas? Thanks in advanceCode:Public Sub List_Update() zero = 0 Set rs = New ADODB.Recordset sql = "SELECT * FROM itemsInStock" rs.Open sql, con, adOpenForwardOnly, adLockReadOnly, adCmdText With lstOutOfStockItems .clear 'clears any data already in the list Do While Not rs.EOF ' do the following when not end of table rs.Find "itemsInStock = " & zero & "" .AddItem rs.Fields("itemName").Value 'adds an item to the list from itemsInStock table .ItemData(.NewIndex) = rs.Fields("itemsID").Value 'primary key from database set as list index rs.MoveNext 'move to next record Loop 'carry on loop until end of table End With rs.Close 'closes the recordset Set rs = Nothing 'sets rs to nothing 'End If End Sub




Reply With Quote