Home All Groups Group Topic Archive Search About

Windows UserID and Access

Author
28 Jun 2006 7:24 PM
GregH.
Is there a way for a database to pull the user ID from the PC when some one
opens it?

What i have is a form to track when my reps login and out for their shift
and i want to see if people are logging in for other people when they are
actually not there.  Everyone has a unique ID they log into the network with
and i would like to capture that and record who was logged into that coumpter
when they left that record.

Thanks

Author
28 Jun 2006 10:06 PM
Douglas J. Steele
Check http://www.mvps.org/access/api/api0008.htm at "The Access Web"

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


Show quoteHide quote
"GregH." <Gre***@discussions.microsoft.com> wrote in message
news:846DEFC0-F75C-4B52-ABC3-7DCBD1D08D44@microsoft.com...
> Is there a way for a database to pull the user ID from the PC when some
> one
> opens it?
>
> What i have is a form to track when my reps login and out for their shift
> and i want to see if people are logging in for other people when they are
> actually not there.  Everyone has a unique ID they log into the network
> with
> and i would like to capture that and record who was logged into that
> coumpter
> when they left that record.
>
> Thanks
Author
29 Jun 2006 10:40 PM
GregH.
I have limited knowldge of this type of stuff so i have another question. 
How do i use this so when they access a form, it will use this code to grab
the user ID and add it to the table record?  Thanks

Show quoteHide quote
"Douglas J. Steele" wrote:

> Check http://www.mvps.org/access/api/api0008.htm at "The Access Web"
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "GregH." <Gre***@discussions.microsoft.com> wrote in message
> news:846DEFC0-F75C-4B52-ABC3-7DCBD1D08D44@microsoft.com...
> > Is there a way for a database to pull the user ID from the PC when some
> > one
> > opens it?
> >
> > What i have is a form to track when my reps login and out for their shift
> > and i want to see if people are logging in for other people when they are
> > actually not there.  Everyone has a unique ID they log into the network
> > with
> > and i would like to capture that and record who was logged into that
> > coumpter
> > when they left that record.
> >
> > Thanks
>
>
>
Author
29 Jun 2006 11:40 PM
Douglas J. Steele
Easiest place would be in the form's BeforeInsert event.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


Show quoteHide quote
"GregH." <Gr***@discussions.microsoft.com> wrote in message
news:529CBCA3-F729-47BD-872B-4DD7F7B6FA16@microsoft.com...
>I have limited knowldge of this type of stuff so i have another question.
> How do i use this so when they access a form, it will use this code to
> grab
> the user ID and add it to the table record?  Thanks
>
> "Douglas J. Steele" wrote:
>
>> Check http://www.mvps.org/access/api/api0008.htm at "The Access Web"
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no private e-mails, please)
>>
>>
>> "GregH." <Gre***@discussions.microsoft.com> wrote in message
>> news:846DEFC0-F75C-4B52-ABC3-7DCBD1D08D44@microsoft.com...
>> > Is there a way for a database to pull the user ID from the PC when some
>> > one
>> > opens it?
>> >
>> > What i have is a form to track when my reps login and out for their
>> > shift
>> > and i want to see if people are logging in for other people when they
>> > are
>> > actually not there.  Everyone has a unique ID they log into the network
>> > with
>> > and i would like to capture that and record who was logged into that
>> > coumpter
>> > when they left that record.
>> >
>> > Thanks
>>
>>
>>
Author
30 Jun 2006 7:09 PM
GregH.
I was not able to get that to work but here is what i was able to do.

I created a new module added the code you directed me to and named it
fOSUserName.

Then in the form i added a text box and under the control source i added
=[fOSUserName].

When i open the form, it grabs the user id but when i go to save the record,
that is not saved anywhere.  How do i take that information i pull and save
it in the table?

Show quoteHide quote
"Douglas J. Steele" wrote:

> Easiest place would be in the form's BeforeInsert event.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "GregH." <Gr***@discussions.microsoft.com> wrote in message
> news:529CBCA3-F729-47BD-872B-4DD7F7B6FA16@microsoft.com...
> >I have limited knowldge of this type of stuff so i have another question.
> > How do i use this so when they access a form, it will use this code to
> > grab
> > the user ID and add it to the table record?  Thanks
> >
> > "Douglas J. Steele" wrote:
> >
> >> Check http://www.mvps.org/access/api/api0008.htm at "The Access Web"
> >>
> >> --
> >> Doug Steele, Microsoft Access MVP
> >> http://I.Am/DougSteele
> >> (no private e-mails, please)
> >>
> >>
> >> "GregH." <Gre***@discussions.microsoft.com> wrote in message
> >> news:846DEFC0-F75C-4B52-ABC3-7DCBD1D08D44@microsoft.com...
> >> > Is there a way for a database to pull the user ID from the PC when some
> >> > one
> >> > opens it?
> >> >
> >> > What i have is a form to track when my reps login and out for their
> >> > shift
> >> > and i want to see if people are logging in for other people when they
> >> > are
> >> > actually not there.  Everyone has a unique ID they log into the network
> >> > with
> >> > and i would like to capture that and record who was logged into that
> >> > coumpter
> >> > when they left that record.
> >> >
> >> > Thanks
> >>
> >>
> >>
>
>
>
Author
30 Jun 2006 11:56 PM
Douglas J. Steele
Rename the module. Modules cannot have the same name as functions or subs
contained within them.

Also, use =fOsUserName() as the Control Source, rather than what you have.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


Show quoteHide quote
"GregH." <Gr***@discussions.microsoft.com> wrote in message
news:CA941A7D-D8B1-4041-8AF8-AECD10B09BA6@microsoft.com...
>I was not able to get that to work but here is what i was able to do.
>
> I created a new module added the code you directed me to and named it
> fOSUserName.
>
> Then in the form i added a text box and under the control source i added
> =[fOSUserName].
>
> When i open the form, it grabs the user id but when i go to save the
> record,
> that is not saved anywhere.  How do i take that information i pull and
> save
> it in the table?
>
> "Douglas J. Steele" wrote:
>
>> Easiest place would be in the form's BeforeInsert event.
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no private e-mails, please)
>>
>>
>> "GregH." <Gr***@discussions.microsoft.com> wrote in message
>> news:529CBCA3-F729-47BD-872B-4DD7F7B6FA16@microsoft.com...
>> >I have limited knowldge of this type of stuff so i have another
>> >question.
>> > How do i use this so when they access a form, it will use this code to
>> > grab
>> > the user ID and add it to the table record?  Thanks
>> >
>> > "Douglas J. Steele" wrote:
>> >
>> >> Check http://www.mvps.org/access/api/api0008.htm at "The Access Web"
>> >>
>> >> --
>> >> Doug Steele, Microsoft Access MVP
>> >> http://I.Am/DougSteele
>> >> (no private e-mails, please)
>> >>
>> >>
>> >> "GregH." <Gre***@discussions.microsoft.com> wrote in message
>> >> news:846DEFC0-F75C-4B52-ABC3-7DCBD1D08D44@microsoft.com...
>> >> > Is there a way for a database to pull the user ID from the PC when
>> >> > some
>> >> > one
>> >> > opens it?
>> >> >
>> >> > What i have is a form to track when my reps login and out for their
>> >> > shift
>> >> > and i want to see if people are logging in for other people when
>> >> > they
>> >> > are
>> >> > actually not there.  Everyone has a unique ID they log into the
>> >> > network
>> >> > with
>> >> > and i would like to capture that and record who was logged into that
>> >> > coumpter
>> >> > when they left that record.
>> >> >
>> >> > Thanks
>> >>
>> >>
>> >>
>>
>>
>>
Author
5 Jul 2006 9:23 PM
GregH.
so i loaded the code and saved it as module1.  I went back to the form and
changed the control source to =fOSUserName().  When i open the form, my user
ID is displayed along with a memo text box.  I enter reanom information in
the text box and save the record but when i look back at the table the user
ID is not there but the information i entered into the memo text box is
there.  Could there be a problem linking the field in the form with the
table?  From my point of view it seems like there is no way for the field in
the folr to match up with the table it was credted from.  If it would help, i
can send you an example of what im working on so you can see it.  I really
appreciate all the help.

Show quoteHide quote
"Douglas J. Steele" wrote:

> Rename the module. Modules cannot have the same name as functions or subs
> contained within them.
>
> Also, use =fOsUserName() as the Control Source, rather than what you have.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "GregH." <Gr***@discussions.microsoft.com> wrote in message
> news:CA941A7D-D8B1-4041-8AF8-AECD10B09BA6@microsoft.com...
> >I was not able to get that to work but here is what i was able to do.
> >
> > I created a new module added the code you directed me to and named it
> > fOSUserName.
> >
> > Then in the form i added a text box and under the control source i added
> > =[fOSUserName].
> >
> > When i open the form, it grabs the user id but when i go to save the
> > record,
> > that is not saved anywhere.  How do i take that information i pull and
> > save
> > it in the table?
> >
> > "Douglas J. Steele" wrote:
> >
> >> Easiest place would be in the form's BeforeInsert event.
> >>
> >> --
> >> Doug Steele, Microsoft Access MVP
> >> http://I.Am/DougSteele
> >> (no private e-mails, please)
> >>
> >>
> >> "GregH." <Gr***@discussions.microsoft.com> wrote in message
> >> news:529CBCA3-F729-47BD-872B-4DD7F7B6FA16@microsoft.com...
> >> >I have limited knowldge of this type of stuff so i have another
> >> >question.
> >> > How do i use this so when they access a form, it will use this code to
> >> > grab
> >> > the user ID and add it to the table record?  Thanks
> >> >
> >> > "Douglas J. Steele" wrote:
> >> >
> >> >> Check http://www.mvps.org/access/api/api0008.htm at "The Access Web"
> >> >>
> >> >> --
> >> >> Doug Steele, Microsoft Access MVP
> >> >> http://I.Am/DougSteele
> >> >> (no private e-mails, please)
> >> >>
> >> >>
> >> >> "GregH." <Gre***@discussions.microsoft.com> wrote in message
> >> >> news:846DEFC0-F75C-4B52-ABC3-7DCBD1D08D44@microsoft.com...
> >> >> > Is there a way for a database to pull the user ID from the PC when
> >> >> > some
> >> >> > one
> >> >> > opens it?
> >> >> >
> >> >> > What i have is a form to track when my reps login and out for their
> >> >> > shift
> >> >> > and i want to see if people are logging in for other people when
> >> >> > they
> >> >> > are
> >> >> > actually not there.  Everyone has a unique ID they log into the
> >> >> > network
> >> >> > with
> >> >> > and i would like to capture that and record who was logged into that
> >> >> > coumpter
> >> >> > when they left that record.
> >> >> >
> >> >> > Thanks
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>
Author
5 Jul 2006 9:28 PM
Douglas J. Steele
Unless the control source is a field in the underlying recordset, whatever
is in the text box isn't going to get saved.

Your options are to use VBA code to populate the text box, or, assuming that
you don't want the User Id to change for records that have already been
saved, set the text box's Default Value to the function.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


Show quoteHide quote
"GregH." <Gr***@discussions.microsoft.com> wrote in message
news:C16F8822-9A51-4506-BC04-7048B78C3E49@microsoft.com...
> so i loaded the code and saved it as module1.  I went back to the form and
> changed the control source to =fOSUserName().  When i open the form, my
> user
> ID is displayed along with a memo text box.  I enter reanom information in
> the text box and save the record but when i look back at the table the
> user
> ID is not there but the information i entered into the memo text box is
> there.  Could there be a problem linking the field in the form with the
> table?  From my point of view it seems like there is no way for the field
> in
> the folr to match up with the table it was credted from.  If it would
> help, i
> can send you an example of what im working on so you can see it.  I really
> appreciate all the help.
>
> "Douglas J. Steele" wrote:
>
>> Rename the module. Modules cannot have the same name as functions or subs
>> contained within them.
>>
>> Also, use =fOsUserName() as the Control Source, rather than what you
>> have.
>>
>> --
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no private e-mails, please)
>>
>>
>> "GregH." <Gr***@discussions.microsoft.com> wrote in message
>> news:CA941A7D-D8B1-4041-8AF8-AECD10B09BA6@microsoft.com...
>> >I was not able to get that to work but here is what i was able to do.
>> >
>> > I created a new module added the code you directed me to and named it
>> > fOSUserName.
>> >
>> > Then in the form i added a text box and under the control source i
>> > added
>> > =[fOSUserName].
>> >
>> > When i open the form, it grabs the user id but when i go to save the
>> > record,
>> > that is not saved anywhere.  How do i take that information i pull and
>> > save
>> > it in the table?
>> >
>> > "Douglas J. Steele" wrote:
>> >
>> >> Easiest place would be in the form's BeforeInsert event.
>> >>
>> >> --
>> >> Doug Steele, Microsoft Access MVP
>> >> http://I.Am/DougSteele
>> >> (no private e-mails, please)
>> >>
>> >>
>> >> "GregH." <Gr***@discussions.microsoft.com> wrote in message
>> >> news:529CBCA3-F729-47BD-872B-4DD7F7B6FA16@microsoft.com...
>> >> >I have limited knowldge of this type of stuff so i have another
>> >> >question.
>> >> > How do i use this so when they access a form, it will use this code
>> >> > to
>> >> > grab
>> >> > the user ID and add it to the table record?  Thanks
>> >> >
>> >> > "Douglas J. Steele" wrote:
>> >> >
>> >> >> Check http://www.mvps.org/access/api/api0008.htm at "The Access
>> >> >> Web"
>> >> >>
>> >> >> --
>> >> >> Doug Steele, Microsoft Access MVP
>> >> >> http://I.Am/DougSteele
>> >> >> (no private e-mails, please)
>> >> >>
>> >> >>
>> >> >> "GregH." <Gre***@discussions.microsoft.com> wrote in message
>> >> >> news:846DEFC0-F75C-4B52-ABC3-7DCBD1D08D44@microsoft.com...
>> >> >> > Is there a way for a database to pull the user ID from the PC
>> >> >> > when
>> >> >> > some
>> >> >> > one
>> >> >> > opens it?
>> >> >> >
>> >> >> > What i have is a form to track when my reps login and out for
>> >> >> > their
>> >> >> > shift
>> >> >> > and i want to see if people are logging in for other people when
>> >> >> > they
>> >> >> > are
>> >> >> > actually not there.  Everyone has a unique ID they log into the
>> >> >> > network
>> >> >> > with
>> >> >> > and i would like to capture that and record who was logged into
>> >> >> > that
>> >> >> > coumpter
>> >> >> > when they left that record.
>> >> >> >
>> >> >> > Thanks
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>
Author
6 Jul 2006 10:12 PM
GregH.
Thanks so much.  The default value is exactly what i needed.

Show quoteHide quote
"Douglas J. Steele" wrote:

> Unless the control source is a field in the underlying recordset, whatever
> is in the text box isn't going to get saved.
>
> Your options are to use VBA code to populate the text box, or, assuming that
> you don't want the User Id to change for records that have already been
> saved, set the text box's Default Value to the function.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "GregH." <Gr***@discussions.microsoft.com> wrote in message
> news:C16F8822-9A51-4506-BC04-7048B78C3E49@microsoft.com...
> > so i loaded the code and saved it as module1.  I went back to the form and
> > changed the control source to =fOSUserName().  When i open the form, my
> > user
> > ID is displayed along with a memo text box.  I enter reanom information in
> > the text box and save the record but when i look back at the table the
> > user
> > ID is not there but the information i entered into the memo text box is
> > there.  Could there be a problem linking the field in the form with the
> > table?  From my point of view it seems like there is no way for the field
> > in
> > the folr to match up with the table it was credted from.  If it would
> > help, i
> > can send you an example of what im working on so you can see it.  I really
> > appreciate all the help.
> >
> > "Douglas J. Steele" wrote:
> >
> >> Rename the module. Modules cannot have the same name as functions or subs
> >> contained within them.
> >>
> >> Also, use =fOsUserName() as the Control Source, rather than what you
> >> have.
> >>
> >> --
> >> Doug Steele, Microsoft Access MVP
> >> http://I.Am/DougSteele
> >> (no private e-mails, please)
> >>
> >>
> >> "GregH." <Gr***@discussions.microsoft.com> wrote in message
> >> news:CA941A7D-D8B1-4041-8AF8-AECD10B09BA6@microsoft.com...
> >> >I was not able to get that to work but here is what i was able to do.
> >> >
> >> > I created a new module added the code you directed me to and named it
> >> > fOSUserName.
> >> >
> >> > Then in the form i added a text box and under the control source i
> >> > added
> >> > =[fOSUserName].
> >> >
> >> > When i open the form, it grabs the user id but when i go to save the
> >> > record,
> >> > that is not saved anywhere.  How do i take that information i pull and
> >> > save
> >> > it in the table?
> >> >
> >> > "Douglas J. Steele" wrote:
> >> >
> >> >> Easiest place would be in the form's BeforeInsert event.
> >> >>
> >> >> --
> >> >> Doug Steele, Microsoft Access MVP
> >> >> http://I.Am/DougSteele
> >> >> (no private e-mails, please)
> >> >>
> >> >>
> >> >> "GregH." <Gr***@discussions.microsoft.com> wrote in message
> >> >> news:529CBCA3-F729-47BD-872B-4DD7F7B6FA16@microsoft.com...
> >> >> >I have limited knowldge of this type of stuff so i have another
> >> >> >question.
> >> >> > How do i use this so when they access a form, it will use this code
> >> >> > to
> >> >> > grab
> >> >> > the user ID and add it to the table record?  Thanks
> >> >> >
> >> >> > "Douglas J. Steele" wrote:
> >> >> >
> >> >> >> Check http://www.mvps.org/access/api/api0008.htm at "The Access
> >> >> >> Web"
> >> >> >>
> >> >> >> --
> >> >> >> Doug Steele, Microsoft Access MVP
> >> >> >> http://I.Am/DougSteele
> >> >> >> (no private e-mails, please)
> >> >> >>
> >> >> >>
> >> >> >> "GregH." <Gre***@discussions.microsoft.com> wrote in message
> >> >> >> news:846DEFC0-F75C-4B52-ABC3-7DCBD1D08D44@microsoft.com...
> >> >> >> > Is there a way for a database to pull the user ID from the PC
> >> >> >> > when
> >> >> >> > some
> >> >> >> > one
> >> >> >> > opens it?
> >> >> >> >
> >> >> >> > What i have is a form to track when my reps login and out for
> >> >> >> > their
> >> >> >> > shift
> >> >> >> > and i want to see if people are logging in for other people when
> >> >> >> > they
> >> >> >> > are
> >> >> >> > actually not there.  Everyone has a unique ID they log into the
> >> >> >> > network
> >> >> >> > with
> >> >> >> > and i would like to capture that and record who was logged into
> >> >> >> > that
> >> >> >> > coumpter
> >> >> >> > when they left that record.
> >> >> >> >
> >> >> >> > Thanks
> >> >> >>
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>