How do i have a counter that counts the number of documents that have been opened in the same database? By the way, i’m thinking of placing the Counter inside one of the documents in the same database as a main document
Off the top of my head (plus it is a Monday morning :-(), there are two ways you could do this.
On the QueryOpen/WebQueryOpen event of the document form in question, run an agent that writes an incremental count to statistic documents. You could keep track of individual forms/documents in this way, and your counts would be real time. There is a small penalty in running a QueryOpen/WebQueryOpen agent, but in my experience with a properly configured server this is generally not a problem.
You have a scheduled agent scan the documents looking for documents with a last accessed date (@accessed) of @yesterday (note the special points that apply to the use of @accessed) and update statistics documents. Your counts will, of course, be available only at the end of the day.
With either of these two approaches, your reporting can be as simple or complex as you like. FWIW, I generally use the approach in 2 whenever possible.