Private Sub Command1_Click()
Dim xSold As Integer
Set db = New ADODB.Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "\inventory.mdb"
Set rs = New ADODB.Recordset
rs.Open "SELECT * FROM storage WHERE Current Stock = '" & Text1.Text & "'", db, adOpenStatic, adLockOptimistic
If rs.BOF = True Or rs.EOF = True Then
MsgBox "No items available to sell."
Exit Sub
Else
xSold = rs!Form5.Adodc1.Recordset.Fields("Current Stock") = Text7.Text
xSold = xSold - 1
rs!ItemInStockAmountNameHere = xSold
rs.Update
End If
End Sub
'can someone tell what is wrong with my codes...error says that "Method 'Open' of object '_Recordset' failed....
please help me...need help ASAP...