Thank you, Jason. That worked beautifully.
Susan
On Jul 7, 2009, at 2:50 PM, Jason L DeLooze wrote:
> Susan,
>
> Your problem is that Contact::g_User is a global field. The value
> in a global field is held locally; that is, each FMP client has
> their own copy of the global field and do not share the value with
> other users.
>
> The solution is to make the g_User field a stored (non-global) field
> in a single record which all Users can access. This means that this
> g_Users (or "CurrentUser") field will not be in the Contact table,
> which probably has more than 1 record. You will want to create a
> new table - a Preferences table perhaps - which has only 1 record
> and will be used to store items such as "g_User" (or "CurrentUser").
> ===
>
> Like Bruce, I also wonder why you are restricting database access to
> one User at a time.
>
> Aloha,
> Jason L. DeLooze
> Honolulu, HI USA
>
>
> On 7/7/09 at 2:27 PM -0800, Susan Gibson wrote:
>> Greetings everyone,
>>
>> I have a solution for a small office with a limited number of users
>> in 2 separate locations. The solution is restricted to one user at
>> a time and uses a script to prevent multiple users from logging in
>> at the simultaneously. Is there a way to display who is logged in
>> via a Custom Message? This is what I've tried but it doesn't
>> display the username as I'd hoped:
>>
>> #make sure only 1 user is connected
>> If [Get (UserCount) < 2 ]
>> Set Field [Contact::g_User; Get ( UserName)]
>> Else if (Get ( UserCount) > 1]
>> Show Custom Dialog [Title: "Message"; Message: "The database is
>> currently in use by " & Contact::g_User]
>> Close Window [Current Window]
>> Exit Script []
>> End if
>>
>> I'm using FMP 9 Advanced.
>>
>> Thanks,
>> Susan
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~
>> Susan Gibson
>>
[hidden email]
> _______________________________________________
> FMPexperts mailing list
>
[hidden email]
>
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Susan Gibson, Tech Manager
Marketing & Communications
University of Alaska Fairbanks
tel: 907-474-2784 fax: 907-474-6283
My email has changed to
[hidden email] but or the time being,
[hidden email]
also works.
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au