Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tracking "Hits" on a Record 1

Status
Not open for further replies.

Milin

Technical User
Jan 5, 2000
33
US
Hello, <br>
<br>
I have a small rolodex program that I have created with Access97. It has a front-end form that users use to lookup info. Is there a way to track the number of times that each record is accessed? I want to be able to see the most popular entries as accessed by the users.<br>
<br>
Thanks,<br>
Milin
 
Yes you can do anything you want in Access but it depends on how adept you are.<br>
First you need an extra field to put a number in<br>
<br>
then you will create a query that looks at that number and sorts that field in descending order largest number at the top.<br>
<p> DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br>
 
I'm guessing you have a form which displays the information and either a combobox which you use for the search function or you allow the users to use the built-in &quot;find&quot; function to locate the correct record.<br>
<br>
In any case, you can attach a macro or code to the forms &quot;On Current&quot; event which runs an update query to increment a counter field in your database table.<br>
<br>
If you still need help, send me an email and I can send you an example. <p>Jim Conrad<br><a href=mailto:jconrad3@visteon.com>jconrad3@visteon.com</a><br><a href= > </a><br>
 
If the form always opens to the first record in the data set you'd want to avoid incrementing the counter for that record.
 
elizabeth -- Excellent observation. Thanks. <p>Jim Conrad<br><a href=mailto:jconrad3@visteon.com>jconrad3@visteon.com</a><br><a href= > </a><br>
 
Milin,<br>
Here, as with any solution, you'll want to clearly define your objectives. Ie, what do you mean by 'accessed'? Elizabeth's point is very good, and going further--what if the user hit's the navigation buttons back and forth while browsing the the form--a record may get 10 hits, and it might not even be the one the user was really after. I'd suggest using a 'Search' button, and open the form with the recordsource (should be a query or dynamic sql) with no records, ie. &quot;WHERE CustomerID = 0&quot;. Turn off the 'recordselectors', 'navigation buttons' properties, etc. This is how you lock things down and get control of what users are doing. Then in the search button event, use whatever fields you allow to search on, and you set the recordsource sql. A found record updates the field as JimConrad suggested.<br>
This is my suggestion for most Access forms anyway. it's easy to turn off the navigation buttons, etc, and to create your own 'next record' buttons, etc. The advantage is that *you* have control over these actions, and can track these things you need to track with accuracy. Yes, I'm a control-freak like that :) It'll keep headaches to a minimum when you know exactly what your users are allowed to do with regard to record navigation.<br>
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top