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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Enter User Name Question

Status
Not open for further replies.

threetone

IS-IT--Management
Mar 22, 2002
28
US
I am fmailiar with creating a text field, choosing options, and setting up the option to auto enter user name. My problem is that I have different users using a computer and I want to track created by and modified by for each record. It is too much to ask inexperienced users to go to Edit>Preferences>Application and fill in their name, much less control spelling and input for advanced users.

Is there an easy way to set up a login script that will automatically fill in the Edit>Preferences>Application> User name preference?

Or an easy way to set up a script that will let the user choose their name from a list or another fm file (i.e. users.fp5), store that in a global field and auto enter that name in a created by and modified by field for each record? How can it be set up for multiple users simultaneously using the file?

I could think of a script to do this, but I want to know if there is an easy way to set the User name preference, or if anyone has already written a script I can use to easily integrete into my relational database.
 
One way to do this is to have the program go to a login screen. The user has to enter a valid login name to pass this screen. The active user name is copied to a global field.

Each record can contain a history log. Any changes made to that record can be recorded is a diary type of log.

For example:

12/2/2003 10:32 am User: Bob modified First Name: James Phone Number: 555-2211.

You can not only track who made the changes but what change was made. This is done with calculations.

Here is the concept. You would obviously need a modification date and time field. Then for any other field you wish to track changes made to, set up a duplicate field.

For example:

First Name also setup First Name chk
Last Name also setup Last Name chk
and so on.

Then through a script you can compare with a relationship of First name and First Name chk to see if the values are equal = to each other. If the values are different a change was made. The script then writes the new value from First Name to First Name chk. Use the setfield command to "set" tracking field & add the First Name field. The script would by pass the setfield option in the event no change was detected.

When you use the setfield command, you are coping the contents of the track field to itself plus First Name. This will keep a history of the changes made always available. When designing the script use the paragraph symbol to assist in formating a space between each entry. To make it read like a sentence you use:
setfield(track,track&paragraph&"First Name: "&First Name(field)

This script should be called up with an existing navigation button that the user needs to use to leave the current record.

Anyway, this is one way to do this.

I hope this helps.

Marty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top