Hello, I may be requesting a lot, but I have a problem. I have made a program that can identify a entry in a field (ID) and change the quantity of a field. However, if can only identify numbers. I have the code as follows:
The "where ID2 = " only works with numbers. Is there anyway I can make this work with Strings? Basically, Find the string in a column and update the quantity. Thanks a lot, appreciate all the help.
Code:
Option Compare Database
Sub AddToInventory()
Dim tb As DAO.Recordset
Dim I As Integer
I = 1
Do Until I = 2
On Error GoTo Canceled
Set tb = CurrentDb.OpenRecordset("Select InitialLevel from Inventory where ID2 = " & InputBox("Enter Item ID"))
If tb.EOF = False Then
tb.Edit
tb!InitialLevel = tb!InitialLevel + 1
tb.Update
End If
tb.Close
Loop
Canceled:
End Sub
The "where ID2 = " only works with numbers. Is there anyway I can make this work with Strings? Basically, Find the string in a column and update the quantity. Thanks a lot, appreciate all the help.