Opening the report opens the object. Then the report closes without closing that object.
You need to add code to the report (or the report opening routine) wherein the object gets closed when it is no longer needed.
I know that is pretty vague, but then, so is what you posted.
The SQL itself is not the issue. Just guessing here, but perhaps something like
Code:
Private Sub mnuCentreListExaminer_Click()
' <ââ<<< What is this apostrophe here for?
DataEnvironment1.Command4 cmbExaminerno.Text '<ââ<<< And this one?
DataReport4.Show
DataEnvironment1.Close
End Sub
or
Code:
Private Sub mnuCentreListExaminer_Click()
If DataEnvironment1.State <> Whatever_the_Const_is_for_Closed Then
DataEnvironment1.Close
End If
DataEnvironment1.Command4 cmbExaminerno.Text
DataReport4.Show
End Sub
(Probably would be best to keep the unconditional .Close when you are done with the object, [u]and</u> add code to test the objectâs state before trying to use it. Though making tests like this slow your code a bitâpractically immeasurablyâthey make your code overcome obstacles effortlessly.)