Hi,
I am running this code to calculate some expressions using the values stored in a table and then return them to another table. I am using a For loop with a counter to move from one row to the next. However, when I run the code, I get error 2471. The code is:
PartID is of text data type. I am just starting out in using VBA for MS Access, and I know I have probably missed something that is rudimentary to you guys. So please bear with me
I am running this code to calculate some expressions using the values stored in a table and then return them to another table. I am using a For loop with a counter to move from one row to the next. However, when I run the code, I get error 2471. The code is:
Code:
Private Sub LRB_TAC_btn_Click()
Dim NumParts Demand as Integer
NumParts = Forms!LTAC_frm!NumParts_tbx.Value
For Counter = 1 To NumParts
Demand = DLookup("[Estimated Annual Usage]", "TempLRB_tbl", "PartID = 'Counter'")
PartID is of text data type. I am just starting out in using VBA for MS Access, and I know I have probably missed something that is rudimentary to you guys. So please bear with me
