Hi
i have a sub which creates a folder based on the active folder, my question is how do i make so it creates a folder when a new user is added to a table
user table is
Table_Users
user_ID
Firstname
Lastname
Usergroup
password
emailAddress
UserName
how do i set it so the UserName of the newly created user is used as the folder name
i have a sub which creates a folder based on the active folder, my question is how do i make so it creates a folder when a new user is added to a table
Code:
Private Sub btnSaveClose_Click()
Const strParent = "\\dlreng01\Roberts$\Access\Images\"
Dim struserID As String
Dim strFolder As String
Dim fso As Object
' Get user ID from control
struserID = Me.User_ID
' Full path
strFolder = strParent & struserID
' Create FileSystemObject
Set fso = CreateObject("Scripting.FileSystemObject")
' Check whether folder exists
If fso.FolderExists(strFolder) = False Then
' If not, create it
fso.CreateFolder strFolder
End If
' Open it
Shell "explorer.exe " & strFolder, vbNormalFocus
End Sub
user table is
Table_Users
user_ID
Firstname
Lastname
Usergroup
password
emailAddress
UserName
how do i set it so the UserName of the newly created user is used as the folder name