How to Get the Windows Username in MS Access

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ธ.ค. 2024

ความคิดเห็น • 27

  • @lorimartin3760
    @lorimartin3760 4 หลายเดือนก่อน +1

    Thank you for posting this, it was exactly what I was looking for! I am running into an error where if the user deletes their name the form gives an error message "Update or Cancel/Update w/out Add/New or Edit" is there anyway to make this stop coming up? I am using your code to autofill in who made a change on a line, but it may get filled in in error. I have the code on the "On Lost Focus" event. Any help would be greatly appreciated, thanks!

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  4 หลายเดือนก่อน

      Glad it worked for you! Yes, you can go to the properties of the text box under data and set the Locked property to Yes and it will stop them from editing/removing their name. You can also set Enabled to No (this will grey it out though).

  • @mostafamahmoud6803
    @mostafamahmoud6803 ปีที่แล้ว +1

    thanks for the video , it was really great , can you please show how to get the ip address for the device of the user ?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  ปีที่แล้ว

      You can use a function like this to get the IP:
      Function IpAddress()
      Dim objNics, objNic, strIP, strComputer, strIps
      Set objNics = GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
      For Each objNic in objNics
      if objNic.IPEnabled then
      strIP = objNic.IPAddress(0)
      If Len(strIps) > 0 Then strIps = strIps & ","
      strIps = strIps & strIP
      End if
      Next
      IpAddress = strIps
      End Function
      To use it, load your variable:
      strIp = IpAddress()
      MsgBox strIP
      or do what you want with it!

  • @hassanrozh6579
    @hassanrozh6579 ปีที่แล้ว +1

    Thanks so much, great video.

  • @jupiter2479
    @jupiter2479 ปีที่แล้ว +1

    You’re a life saver
    Thank you

  • @jerzykepinski
    @jerzykepinski ปีที่แล้ว +1

    Thanks, this was good!

  • @siclucealucks
    @siclucealucks ปีที่แล้ว +1

    Great excactly I was waiting for

  • @shafiqueahmad9024
    @shafiqueahmad9024 ปีที่แล้ว

    wow. cool solution.
    Sir please make a video on COM control in access. how get data into a table from COM PORT.

  • @interestingamerican3100
    @interestingamerican3100 ปีที่แล้ว +2

    Thank you!!! I was wanting to learn this.

  • @RugbyNo17
    @RugbyNo17 ปีที่แล้ว +2

    This is fantastically useful stuff (like all of your videos). I'd like to request a video on how to obtain a user's email address from the GAL in Outlook if you would. Keep on doing what you do, it's EXTREMELY helpful to a rookie Access developer like me. 😎

  • @gerfer6261
    @gerfer6261 ปีที่แล้ว +1

    1-Handy hint. I have being using second option = environ variable with computer name
    2-Any trick to get the Full name than the login name!!!! Or user email address
    3-User logger also very handy I get login time and log off time
    4- Could not find it in the Download page appreciate if you add it so that I could get it into my collection
    As always appreciate your knowledge base contribution
    Cheers 🏃🏽

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  ปีที่แล้ว

      Thanks for the feedback! The downloads page has been updated. Getting more information about the user is possible through a LDAP query if you're in a domain, but that is another function that we will have to explore in another video. I'll add it to my list. cheers

  • @abedalil8739
    @abedalil8739 ปีที่แล้ว +1

    Can you get Windows Password like Username ?!!🙂

  • @alessiosonis981
    @alessiosonis981 9 หลายเดือนก่อน +1

    I can imagine that this "function" could be used when closing the mask! @seanmackenziedataengineering

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  9 หลายเดือนก่อน +1

      Thanks for sharing!

    • @alessiosonis981
      @alessiosonis981 9 หลายเดือนก่อน +2

      @@seanmackenziedataengineering I took this tutorial and the one "How to Kick Users out of Your MS Access Database" because I would like to create a log file of accesses and exits from the database. Obviously I divided the DB into FE and BE. Am I on the right track? ps: i follow you from Italy!

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  9 หลายเดือนก่อน +1

      @@alessiosonis981 You bet! You can use this one th-cam.com/video/Rqhlr6NwUu8/w-d-xo.html to log the time a form is closed.