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 Domain Name
Following on this Username() code snippet, here's one for retrieving the user's domain name.
Option Compare Database Option Explicit 'Module name: modUser Private pDomain As String Public Property Get UserDomain() As String 'Source: http://www.accessmvp.com/thedbguy 'Usage: Me.ControlName = modUser.UserDomain If pDomain > "" Then 'Just return the existing domain name Else 'Get domain name pDomain = CreateObject("wscript.network").UserDomain End If UserDomain = pDomain 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