Using Access 2010
Windows 7
I'm sure this is a simple VBA Gramer problem.
I am attempting to update a table.
Below is the code and I'm getting the error on the line BOM("Level") = 1, Line 21. I'm sure lines 22, 25, and 27 will have the same issue.
Windows 7
I'm sure this is a simple VBA Gramer problem.
I am attempting to update a table.
Below is the code and I'm getting the error on the line BOM("Level") = 1, Line 21. I'm sure lines 22, 25, and 27 will have the same issue.
Code:
Private Sub CB_RunQueryPrintReport_Click()
Dim stDocName As String
Dim Filename As String
Dim i, RC, X As Integer
Dim MyDB As DAO.Database
Dim REQ, BOM As DAO.Recordset
Dim UDI As DAO.Recordset2
'Dim BOM As DAO.Recordset
Dim CurrSpecies As String
Set MyDB = DBEngine.Workspaces(0).Databases(0)
Set REQ = MyDB.OpenRecordset("Tbl_REQData", DB_OPEN_TABLE)
Set UDI = MyDB.OpenRecordset("Tbl_UDIData", DB_OPEN_TABLE)
Set BOM = MyDB.OpenRecordset("Tbl_BOM_Level", DB_OPEN_TABLE)
DoCmd.Hourglass True
DoCmd.SetWarnings False
i = 0
BOM("Level") = i
BOM("Prev Level") = i
DoCmd.OpenQuery "Qry_FindPanelParts"
For i = 1 To 7
BOM("Level") = i
DoCmd.OpenQuery "Qry_FindPanelPartsNextLevelDown"
BOM("Prev Level") = i
Next i
etc... error is above:
Comment