amypaulsen
Board Regular
- Joined
- Mar 1, 2004
- Messages
- 114
This is the code I'm using in VB-Excel to pull info out of access:
Set objDB = objAccess.currentdb()
With objDB
strSQL = "select " & QueryName & ".UNIT, " & QueryName & ".CATEGORY, " & QueryName & "." & WeekNum & " from " & QueryName & " where category = '" & CatName & "';"
Debug.Print strSQL
Set rst = objDB.openrecordset(strSQL)
When I run this, I keep erroring out on the last line "Set rst = objDB.openrecordset(strSQL)" stating: too few parameters, expected 1
When I hover over the SQL statement or look in the locals window, it is clearly recognizing what to pull.
What the HECK am I doing wrong????
Please help!
Set objDB = objAccess.currentdb()
With objDB
strSQL = "select " & QueryName & ".UNIT, " & QueryName & ".CATEGORY, " & QueryName & "." & WeekNum & " from " & QueryName & " where category = '" & CatName & "';"
Debug.Print strSQL
Set rst = objDB.openrecordset(strSQL)
When I run this, I keep erroring out on the last line "Set rst = objDB.openrecordset(strSQL)" stating: too few parameters, expected 1
When I hover over the SQL statement or look in the locals window, it is clearly recognizing what to pull.
What the HECK am I doing wrong????
Please help!