How do I record report views?

G

Guest

Ted,

You need to open a recordset based on the table you're writing to. Then add
a new record and then update the database.

I'm using DAO for my data access. Assuming that you have created the table
and the FE is linked to the BE table:

Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("SELECT * FROM reportlog")
' Get ready to create a new record in the reportlog table.
rst.AddNew
' I made up some plausible column names for the reportlog table.
rst![User] = CurrentUser
rst![Date] = Now
rst!
= Me.RecordSource
' Now, write the record to the actual table.
rst.Update
' Clean up.
Set rst = Nothing


That should be close to the needed code to accomplish this task.

Greg
 
T

Ted

Hello All,

I want to be able to record when a user "views a report" - the system holds
the variables of [currentuser]; [now()] and [recordsource] which I believe
would be sufficient for my purposes...

How do I take those variables when a report is viewed, and write them to a
table (named 'reportlog') ?

I can view the variables on the report (by creating 'textboxes'), but am not
sure how to then take this data & write it to a table...

My database is split into FE/BE, the reports being in the FE, and the table
in the BE.

Can this be done?


Your advice would be appreciated!

Many thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top