Hi, I use the following code to execute an Access query with from Excel. Then an input box pop up require user to enter a criteria for the query. I'd like to automatically pass a value from Excel to the query criteria. The value is stored in cell E5 or named range "Input" on the Excel file. How do I do that? Thanks.
Dim acObj As Object
Set acObj = CreateObject("Access.Application")
acObj.OpenCurrentDatabase "C:\Documents and Settings\Work\DB.accdb"
Set acObj = Nothing