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!

Counting Records and keeping the count

Status
Not open for further replies.

avw

Technical User
Jun 14, 2003
6
US
I have a field "Count". This is counting the occurance of a word in another field but not a specific word. I want the count to remain as it was originally whenever I access that record. In other words: When I do a find for a particular record I want the count to stay as it was when originally posted and not revert to "1" or however many records the find pulled up.

Anyone?
 
The Count is performing a function counting these occurances of every record in your solution. When you define a FIND you are limiting the number of records that will show thus the number in the Count field too.

One way to go about this is to write a script for your FIND and connect it to a FIND button on your solution. In the script, you could have a number field and have the script do a setfield(numberCount, Count) at the beginning of the script. The number field is what would show on your layout and omit the Count field from the layout. It will countinue to function, counting without being on the layout.

Since this would not likely update the numberCount field unless you did a FIND, you may have another script that will do this setfield for you upon enter the database or to this layout. A navigation to the layout could refer to the setfield. You can write a setfield script and have any number of scripts call it.

I hope this helps.

Marty
 
I was wondering if you could tell me how you are keeping count of these word occurences in another field without specifying the word. I made a post last week and no one has responded but you sound like you have accomplished this. If you could share your knowledge it would be greatly appreciated.
 
Use the
Count(file name). We do personalization so I need to count the names we enter into the database. My field name is called "mono" so this reads Count(mono).

 
Maybe you can help with my problem then. I have a student database and each student has an advisor. If I want a field that shows a count for the number of students under that particular advisor would it be similar to this? Thanks for your help.
 
You will need a unique file for each advisor. For instance File name is Mrs Orange and you will have a field called students. Count(students)


Students field will be unique to each student since name of student will be entered in that field.

You will be able to do a "Find" in each of the advisor's lists for a particular student. You should index the students field.

Marion
 
I also have a student database and would like to create a layout that lists the advisor (teacher) and the number of students in each advisor's class. Could you elaborate more on how to utilize files created for each advisor and retrieve the student count for each advisor for display in the main file?
 
Someone else jump in here if I miss something.

Create files for each advisor. You may have several things about the advisor you wish to include, those would need to be seperate of the advisor's name if you wish to access different info.

List the students under each advisor and do the "count".

You can then make a relationship between the advisor files or in what we will call the master file do a lookup into the advisor files and you can retrieve your data for each advisor as well as the students.

This is a little difficult to explain so if this doesn't make any sense let me know.

I may be able to write the program for you and e-mail it but don't be in a "high Level need" as to time:)

Marion
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top