Code Snippets
In all the times I have spent participating in forum discussions about all sorts of users' questions, I have learnt a great deal from all the participants.
I have decided to post some of the sample codes that I found users were asking for almost all the time to help me keep them in one place and to make it easier for me to share them again and again.
Hope you find them useful.
Get User's Computer Name
Following on this Username() code snippet, here's one for retrieving the user's computer name.
Option Compare Database Option Explicit 'Module name: modUser Private pComputer As String Public Property Get ComputerName() As String 'Source: http://accessmvp.com/thedbguy 'Usage: Me.ControlName = modUser.ComputerName If pComputer > "" Then 'Just return the existing domain name Else 'Get domain name pComputer = CreateObject("wscript.network").ComputerName End If ComputerName = pComputer End Property
Contents
- Generate GUIDs
- Backup and Compact BE
- Get E-mail Address from AD
- Get Network Username
- Leigh's Generic Recordset
- Trim Inner Spaces
- Get Subform Control Name
- The Opposite of DSum()
- Concatenate Records
- Get Network Domain Name
- Get Computer Name
- Get BE Info
- Execute Action Queries
- Extract Email Address