I have an Access (2016) database that used to work when I clicked on a button it would export the data to an Excel spreadsheet. I created the commands in Access's VBA (I am not a VBA programmer) however now when I try to run (click on the button), I get the following error "Compile error: Can't find project or library. Here is the VBA code that I am using:
strSQL = "SELECT * FROM " & "Table_ExpenseReport" & " WHERE " & "[ID] = " & ID & ";"
It is showing that the error is on the ID part. I want this to pull the data in the ID field (cell) in the Access database and keep it as the rest of the command sends that ID's data to the Excel spreadsheet and only that ID's data. Can someone help me? I am more than happy to attach screenshots, etc. to make this work again.