Re: Getting NT User Login Names from Access 2000 or 2003



Well, I went back to the main machine, and it will not assign the field as is.
Also, a Watch, of the variable, does show the boxes after that value.

However, I think I have a workaround. I went into my real target table, and
changed the fld size to 255. It assigned the value, and I cannot 'arrow'
past the end of my name. I will just have to verify that with a query
linking my name, to a static list with my name in it, to see if it matches up.

Also, as I may have mentioned, my routine of getting the username into a
Case stmt, and displaying 'Michael' if the username is mmiller, does work
under the old scheme. So, in that case the extra box chars are ignored. Go
figure.

I think we can close this, as long as the workaround works, but if you can
find out why (if you view the value of strusername, do you see the boxes as I
do?) this happens and how to fix it, I would still like to know, if you
remember me.
--
MichaelM


"Jeff Conrad" wrote:

> Most peculiar.
>
> Humor me some more.
>
> 1. What happens on a different machine with a different user name?
> Same problem or no problems?
>
> 2. Create a completely new blank database.
> Copy and paste the code from here (not the code you have)
> in to a new standard module (not a form's class module):
>
> http://www.mvps.org/access/api/api0008.htm
>
> Create a new test form with text box that has a Default Value
> of
> =fOSUserName()
>
> Does it display properly?
>
> Create a new table called Table1 with these fields:
> IDField Autonumber (PrimaryKey)
> MyUserName Text
> SomeOtherField Text
>
> Save the table.
> Open the form in Design View and set the Record Source of the
> form to Table1. Set the Control Source of your text box to
> MyUserName so it is bound. Bring down the SomeOtherField
> from the Field List so you have two text boxes now.
>
> Save the form.
>
> Now open the form in regular mode.
> Does the User Name display correctly?
>
> Enter something into the other text box to dirty the record.
> Does the User Name get saved correctly to the table now
> or does it still have all the extra stuff?
>
> --
> Jeff Conrad
> Access Junkie
> http://home.bendbroadband.com/conradsystems/accessjunkie.html
> http://www.access.qbuilt.com/html/articles.html
>
> "Michael Miller" wrote in message:
> news:C3145DFB-FF94-4DBB-AF81-D521B8F175A1@xxxxxxxxxxxxxxxx
>
> > Ok, made the form and you cannot see the spaces in my username in a msgbox,
> > so I made it with a strUserName variable, and when I step thru the code -I
> > can- see the square boxes after my username, just as in my real form.
> > --
> > MichaelM
> >
> >
> > "Jeff Conrad" wrote:
> >
> > > Humor me here.
> > >
> > > Create a new blank form and put this code in the Open event.
> > >
> > > Private Sub Form_Open(Cancel As Integer)
> > > MsgBox fOSUserName()
> > > End Sub
> > >
> > > What does the message box say?
> > > Any extra spaces?
>
>
>
.



Relevant Pages

  • how to validate 3 text boxes together
    ... boxes for UserName, FirstName, Email, Old Password, New Password, Confirm ... not sensitive like the UserName, ... So I don't have any required field validators on ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Weird Windows logon attempts
    ... They are 2k/XP boxes. ... > The username has been changed to USERNAME to ... > to account: USERNAME by: ... Do you Yahoo!? ...
    (Incidents)
  • Re: How do I remove need for passwords
    ... Make sure your username and domain are ... 2004 Windows MVP "Winny" Award ... > control panel, users, and uncheck the boxes, but it still ... > The other box says "Logon Message. ...
    (microsoft.public.windowsxp.general)
  • Re: Making Table In Very Top Left Corner
    ... *Sigh*. ... I'm trying to put together a simple login box ... I want the boxes for username and password to be flush along the left ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: error 3048 - Cannot open any more databases
    ... The combo that uses the callback function as its RowSourceType will still be able to display the desired data. ... What happens is that you load the static array one, and then it calls the callback function whenever it needs a value. ... I am using these combo boxes not only as a way of selecting a ... > the same subform, just inserted 48 times. ...
    (microsoft.public.access.formscoding)

Loading