Create a Folder based on new user (1 Viewer)

kobiashi

Registered User.
Local time
Today, 23:42
Joined
May 11, 2018
Messages
258
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

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
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:42
Joined
Feb 19, 2013
Messages
14,221
other than substituting UserName for user_ID (and possibly removing any illegal characters) what is the problem?
 

kobiashi

Registered User.
Local time
Today, 23:42
Joined
May 11, 2018
Messages
258
i dont understand how it references the user who is being created, as appose to the user who is creating
 

CJ_London

Super Moderator
Staff member
Local time
Today, 23:42
Joined
Feb 19, 2013
Messages
14,221
From the little you have provided, I can't tell you either. I'm assuming that your user_ID is your new user
 

Users who are viewing this thread

Top Bottom