I am trying to retrieve a Recordset for a table in the currently open Access 2007 database. However, the RecordSet method, requires a database object. I know that the syntax I need is
Set rstIssues = dbs.OpenRecordset("SELECT DISTINCT * FROM Issues WHERE TTP_No = " & lngSelectedTTP)
where rstIssues is defined as a RecordSet, and dbs is defined as a Database.
But, since the database is already open, how do I retrieve the value for dbs, without actually performing the OpenDatabase command?
Set dbs = OpenDatabase("TTP.accdb")
BTW - When I do perform the OpenDatabase command, I get a msgbox with
Run time error '3024'
Could not find file 'TTP.accdb'