PC Review


Reply
Thread Tools Rate Thread

Auto fill user name

 
 
wishfulthinking
Guest
Posts: n/a
 
      7th Dec 2009
I have a form set up to track what the calls we recieve are about. There are
15ish people that will be using the form and I was wondering if there is a
way to have the form auto fill the name of the user creating the new record,
the way it is set up to auto fill the date and time the new record is
created. This would prevent anyone from accidently clicking on the wrong
name if set it up as a list box. Please advise if this can be done and how.
 
Reply With Quote
 
 
 
 
Daniel Pineault
Guest
Posts: n/a
 
      7th Dec 2009
For the username you could either pull the Network Username and use it
directly, or use a table to cross-reference the Network Username with the
user's real name. One way or another you can automate the whole thing by
using the Network username and the code for that can be found at:

http://www.mvps.org/access/api/api0008.htm

As for the date/time when the record is created. In your form design, set
the default value for the date/time control to =date()
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"wishfulthinking" wrote:

> I have a form set up to track what the calls we recieve are about. There are
> 15ish people that will be using the form and I was wondering if there is a
> way to have the form auto fill the name of the user creating the new record,
> the way it is set up to auto fill the date and time the new record is
> created. This would prevent anyone from accidently clicking on the wrong
> name if set it up as a list box. Please advise if this can be done and how.

 
Reply With Quote
 
Daniel Pineault
Guest
Posts: n/a
 
      7th Dec 2009
Made a slight mistake. If you want a date/time stamp you need to use =Now()
rather than =Date().
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"wishfulthinking" wrote:

> I have a form set up to track what the calls we recieve are about. There are
> 15ish people that will be using the form and I was wondering if there is a
> way to have the form auto fill the name of the user creating the new record,
> the way it is set up to auto fill the date and time the new record is
> created. This would prevent anyone from accidently clicking on the wrong
> name if set it up as a list box. Please advise if this can be done and how.

 
Reply With Quote
 
wishfulthinking
Guest
Posts: n/a
 
      7th Dec 2009
I figured it had something to do with pulling the Network Username but was
unsure how. So your advice sounds great, however my limited Access skills
leave me confused as to how to do anything with a Module. Is it really as
simple as copy and pasting a code? I think I am missing some steps to make
it useful to the form I am using.

"Daniel Pineault" wrote:

> For the username you could either pull the Network Username and use it
> directly, or use a table to cross-reference the Network Username with the
> user's real name. One way or another you can automate the whole thing by
> using the Network username and the code for that can be found at:
>
> http://www.mvps.org/access/api/api0008.htm
>
> As for the date/time when the record is created. In your form design, set
> the default value for the date/time control to =date()
> --
> Hope this helps,
>
> Daniel Pineault
> http://www.cardaconsultants.com/
> For Access Tips and Examples: http://www.devhut.net
> Please rate this post using the vote buttons if it was helpful.
>
>
>
> "wishfulthinking" wrote:
>
> > I have a form set up to track what the calls we recieve are about. There are
> > 15ish people that will be using the form and I was wondering if there is a
> > way to have the form auto fill the name of the user creating the new record,
> > the way it is set up to auto fill the date and time the new record is
> > created. This would prevent anyone from accidently clicking on the wrong
> > name if set it up as a list box. Please advise if this can be done and how.

 
Reply With Quote
 
wishfulthinking
Guest
Posts: n/a
 
      8th Dec 2009
Your help with the date/time stamp works great but I don't understand what to
do with your tip on the user name. I figured it had something to do with
pulling the Network Username but was unsure how. So your advice sounds
great, however my limited Access skills leave me confused as to how to do
anything with a Module. Is it really as simple as copy and pasting a code?
I think I am missing some steps to make it useful to the form I am using.


"Daniel Pineault" wrote:

> Made a slight mistake. If you want a date/time stamp you need to use =Now()
> rather than =Date().
> --
> Hope this helps,
>
> Daniel Pineault
> http://www.cardaconsultants.com/
> For Access Tips and Examples: http://www.devhut.net
> Please rate this post using the vote buttons if it was helpful.
>
>
>
> "wishfulthinking" wrote:
>
> > I have a form set up to track what the calls we recieve are about. There are
> > 15ish people that will be using the form and I was wondering if there is a
> > way to have the form auto fill the name of the user creating the new record,
> > the way it is set up to auto fill the date and time the new record is
> > created. This would prevent anyone from accidently clicking on the wrong
> > name if set it up as a list box. Please advise if this can be done and how.

 
Reply With Quote
 
Daniel Pineault
Guest
Posts: n/a
 
      9th Dec 2009
It is pretty much that easy.

Open the VBE by pressing Alt-F11
Insert a new module and paste in the API Code from the link I supplied
Open your form in design view and in the default value for the name control
enter =fOSUserName()
Close and save your form and the reopen it and see the result
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"wishfulthinking" wrote:

> Your help with the date/time stamp works great but I don't understand what to
> do with your tip on the user name. I figured it had something to do with
> pulling the Network Username but was unsure how. So your advice sounds
> great, however my limited Access skills leave me confused as to how to do
> anything with a Module. Is it really as simple as copy and pasting a code?
> I think I am missing some steps to make it useful to the form I am using.
>
>
> "Daniel Pineault" wrote:
>
> > Made a slight mistake. If you want a date/time stamp you need to use =Now()
> > rather than =Date().
> > --
> > Hope this helps,
> >
> > Daniel Pineault
> > http://www.cardaconsultants.com/
> > For Access Tips and Examples: http://www.devhut.net
> > Please rate this post using the vote buttons if it was helpful.
> >
> >
> >
> > "wishfulthinking" wrote:
> >
> > > I have a form set up to track what the calls we recieve are about. There are
> > > 15ish people that will be using the form and I was wondering if there is a
> > > way to have the form auto fill the name of the user creating the new record,
> > > the way it is set up to auto fill the date and time the new record is
> > > created. This would prevent anyone from accidently clicking on the wrong
> > > name if set it up as a list box. Please advise if this can be done and how.

 
Reply With Quote
 
Mike Deschambault
Guest
Posts: n/a
 
      12th Aug 2010
Daniel, I have tried to follow your directions below, however the field on my form shows #Name?. I have bound the text field on the form to a field in the table which is where I would like the autostamp of the record. It would preferable to only have the timestamp visible in the table and not on the form. Will I need to create a new table for users in order for this function to work?

> On Monday, December 07, 2009 4:05 PM wishfulthinking wrote:


> I have a form set up to track what the calls we recieve are about. There are
> 15ish people that will be using the form and I was wondering if there is a
> way to have the form auto fill the name of the user creating the new record,
> the way it is set up to auto fill the date and time the new record is
> created. This would prevent anyone from accidently clicking on the wrong
> name if set it up as a list box. Please advise if this can be done and how.



>> On Monday, December 07, 2009 4:50 PM Daniel Pineault wrote:


>> For the username you could either pull the Network Username and use it
>> directly, or use a table to cross-reference the Network Username with the
>> user's real name. One way or another you can automate the whole thing by
>> using the Network username and the code for that can be found at:
>>
>> http://www.mvps.org/access/api/api0008.htm
>>
>> As for the date/time when the record is created. In your form design, set
>> the default value for the date/time control to =date()
>> --
>> Hope this helps,
>>
>> Daniel Pineault
>> http://www.cardaconsultants.com/
>> For Access Tips and Examples: http://www.devhut.net
>> Please rate this post using the vote buttons if it was helpful.
>>
>>
>>
>> "wishfulthinking" wrote:



>>> On Monday, December 07, 2009 4:51 PM Daniel Pineault wrote:


>>> Made a slight mistake. If you want a date/time stamp you need to use =Now()
>>> rather than =Date().
>>> --
>>> Hope this helps,
>>>
>>> Daniel Pineault
>>> http://www.cardaconsultants.com/
>>> For Access Tips and Examples: http://www.devhut.net
>>> Please rate this post using the vote buttons if it was helpful.
>>>
>>>
>>>
>>> "wishfulthinking" wrote:



>>>> On Monday, December 07, 2009 6:24 PM KenSheridan via AccessMonster.com wrote:


>>>> However you obtain the user name, and the API call suggested by Daniel is the
>>>> obvious solution, you should also create a Users table with UserName as its
>>>> primary key if you do not already have one, and create an enforced
>>>> relationship between it and the 'calls' table. That way the integrity of the
>>>> data is protected. Even if automating the insertion of a value into the
>>>> UserName column there would otherwise be nothing to prevent a value being
>>>> subsequently changed to that of a non-existent user. This might sound
>>>> unlikely, but Murphy's Law states not.
>>>>
>>>> If you should decide not to use the unique login names, but employees' real
>>>> names then, as names can legitimately be duplicated and therefore are
>>>> unsuitable as keys, the Users table should have a numeric UserID as its key,
>>>> FirstName and LastName columns and a UserName column which corresponds to the
>>>> login name, along with other columns which identify the user such as their
>>>> job title etc., i.e. it would be more of a general Employees table. This
>>>> then caters for having two users of the same name (I worked once with two
>>>> Maggie Taylors). The calls table should then have a numeric UserID column as
>>>> a foreign key referencing the key of Users.
>>>>
>>>> You can then put the following code in the calls form's Open event procedure
>>>> to set the DefaultValue property of its UserID control, which you would make a
>>>> hidden one as there is no point showing the arbitrary numeric value:
>>>>
>>>> Dim strCriteria As String
>>>>
>>>> strCriteria = "UserName = """ & fOSUserName() & """"
>>>>
>>>> Me.UserID.DefaultValue = """" & DLookup("UserID", "Users", strCriteria) &
>>>> """"
>>>>
>>>> You could then show the user name in the form in a control, either an unbound
>>>> one with a ControlSource:
>>>>
>>>> =DLookup("(Firstname + "" "") & LastName", "Users", "UserID= " & [UserID)
>>>>
>>>> or in a bound control if you base the form on a query which joins the calls
>>>> table to the users table. If doing the latter set the control's Enabled
>>>> property to False (No) and its Locked property to True (Yes).
>>>>
>>>> Ken Sheridan
>>>> Stafford, England
>>>>
>>>> wishfulthinking wrote:
>>>>
>>>> --
>>>> Message posted via http://www.accessmonster.com



>>>>> On Monday, December 07, 2009 6:37 PM wishfulthinking wrote:


>>>>> I figured it had something to do with pulling the Network Username but was
>>>>> unsure how. So your advice sounds great, however my limited Access skills
>>>>> leave me confused as to how to do anything with a Module. Is it really as
>>>>> simple as copy and pasting a code? I think I am missing some steps to make
>>>>> it useful to the form I am using.
>>>>>
>>>>> "Daniel Pineault" wrote:



>>>>>> On Tuesday, December 08, 2009 1:54 PM wishfulthinking wrote:


>>>>>> Your help with the date/time stamp works great but I do not understand what to
>>>>>> do with your tip on the user name. I figured it had something to do with
>>>>>> pulling the Network Username but was unsure how. So your advice sounds
>>>>>> great, however my limited Access skills leave me confused as to how to do
>>>>>> anything with a Module. Is it really as simple as copy and pasting a code?
>>>>>> I think I am missing some steps to make it useful to the form I am using.
>>>>>>
>>>>>>
>>>>>> "Daniel Pineault" wrote:



>>>>>>> On Tuesday, December 08, 2009 7:49 PM Daniel Pineault wrote:


>>>>>>> It is pretty much that easy.
>>>>>>>
>>>>>>> Open the VBE by pressing Alt-F11
>>>>>>> Insert a new module and paste in the API Code from the link I supplied
>>>>>>> Open your form in design view and in the default value for the name control
>>>>>>> enter =fOSUserName()
>>>>>>> Close and save your form and the reopen it and see the result
>>>>>>> --
>>>>>>> Hope this helps,
>>>>>>>
>>>>>>> Daniel Pineault
>>>>>>> http://www.cardaconsultants.com/
>>>>>>> For Access Tips and Examples: http://www.devhut.net
>>>>>>> Please rate this post using the vote buttons if it was helpful.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> "wishfulthinking" wrote:



>>>>>>> Submitted via EggHeadCafe - Software Developer Portal of Choice
>>>>>>> Changing WCF Service Implementation at Runtime
>>>>>>> http://www.eggheadcafe.com/tutorials...t-runtime.aspx

 
Reply With Quote
 
Mike Deschambault
Guest
Posts: n/a
 
      12th Aug 2010
sorry, i meant username stamp using network id.

Thanks,

Submitted via EggHeadCafe - Software Developer Portal of Choice
Store ASP.NET Site Visitor Stats in MongoDb
http://www.eggheadcafe.com/tutorials...n-mongodb.aspx
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto fill form where reports auto fill for selection Faron - GMail Microsoft Access Forms 1 16th Jun 2008 07:48 AM
Retrieving Data from a worksheet to auto fill a user form =?Utf-8?B?bWdfc3Zfcg==?= Microsoft Excel Programming 1 16th Jan 2006 10:12 PM
Auto fill of user info doesn't happen =?Utf-8?B?RGJsdGFw?= Microsoft Word Document Management 1 28th Sep 2005 10:20 PM
Auto fill Domain and last user for Outlook2002 and 2003? =?Utf-8?B?U0xIVGVjaA==?= Microsoft Outlook Installation 0 9th Nov 2004 05:54 PM
Auto fill text boxes in user form by inputting data in another Finny33 Microsoft Excel Programming 1 13th Sep 2004 12:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:04 PM.