Create a Folder based on new user

kobiashi

Registered User.
Local time
Today, 16:44
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
 
other than substituting UserName for user_ID (and possibly removing any illegal characters) what is the problem?
 
i dont understand how it references the user who is being created, as appose to the user who is creating
 
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

Back
Top Bottom