'Object was Open' error
Posted on 2005-04-07
In short I run an SQL query and produce a report based on that query. The first time I run the report it works well, however when I run it a second time without closing the form and just by changing one part of the criterion (which works fine in SQL Enterprise Manager - Query Edit Mode) e.g. Male to Female, it errors with the message 'Object was open'. I have searched google but it yields nothing sensible. I have tried a check to see if the recordset is open but it reports as closed.
Dim BookID As Long
.Open "select * from Resource where (AscID = '" & curASCID & "')"
If Not .EOF Then
BookID = .Fields("ResourceID")
I have also put a close statement in the terminate procedure of the data report.