Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8178745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:50:19+00:00 2026-06-06T23:50:19+00:00

I am trying, with a form, to enter a directory, a parent folder name

  • 0

I am trying, with a form, to enter a directory, a parent folder name and then select via tabs which sub-folders will feature within the parent folder using a range of checkboxes.

My user form

I can enter the drive, project name and project number which first checks if the parent folder exists and if not creates it.

I then check if the ‘Use Online’ checkbox is active and if so create an array of the names of all of the other checkboxes within the ‘Online’ tab. It then gets tricky because I want to loop through each of the checkbox names to check whether each one is active and if so, I want to grab the ‘caption’ of each checkbox and use it to create a sub-folder within the parent directory (if it does not already exist).

When I execute my current code I get ‘Run-time error ‘424’ Object required and the line

    If itm.Value = True Then

highlighted in yellow.

All of the code used for the ‘create folders’ part of this user form can be found below:

Private Sub create_folders_button_Click()

'Create a variable for the drive letter
Dim driveLetter As String
driveLetter = drive_list.Value

'Create a variable for the project name
Dim projectName As String
projectName = p_name_textbox.Value

'Create a variable for the project number
Dim projectNumber As String
projectNumber = p_number_textbox.Value

'Create a variable for the constructed BasePath
Dim BasePath As String

'Create a new file system object for handling filesystem manipulation
  Set fs = CreateObject("Scripting.FileSystemObject")

'Populate an array with the online subfolders
  Dim onlineSubfolders As Variant
  onlineSubfolders = Array("online_progCosts", "online_exports")

'Compile the basePath

  BasePath = driveLetter & projectName & " (" & projectNumber & ")"

'Check if the project folder already exists and if so, raise an error and exit
    If Dir(BasePath, vbDirectory) <> "" Then
        MsgBox BasePath & " already exists", , "Error"
    Else
        'Create the project folder
        MkDir BasePath
        MsgBox "Parent folder creation complete"

        If online_toggle.Value = True Then
            Dim online As String
            online = "Online"
            MkDir BasePath & "\" & online

            Dim itm As Variant
            For Each itm In onlineSubfolders
                If folder_creator_window.Controls(itm).Value = True Then
                    Dim createFolder As String
                    createFolder = folder_creator_window.Controls(itm).Caption
                    NewFolder = BasePath & "\" & online & "\" & createFolder
                    If fs.folderexists(NewFolder) Then
                        'do nothing
                    Else
                        MkDir NewFolder
                    End If

                Else
                    'do nothing
                End If

            Next itm

        Else
            MsgBox "The online folder was not created because it was not checked"

        End If

    End If

End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:50:21+00:00Added an answer on June 6, 2026 at 11:50 pm
    ...
    onlineSubfolders = Array("online_progCosts", "online_exports")
    ...
    For Each itm In onlineSubfolders
                If itm.Value = True Then
    ...
    

    Each element of the array is a string. Strings don’t have .Value properties.

    I guess those are the names of your checkboxes, so you need to get the value by referencing the control itself. I don’t know what your form is called.

    If FormName.Controls(itm).Value = True
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a child form that helps the user to enter data
I'm trying to set up a UITableView which acts as a form. Each cell
i'm trying to create form which with which i can upload text and image
Well I am trying to submit a form by pressing enter but not displaying
Hy I'm trying to prevent the user to enter any form of line breaks
I have a simple form written in asp.net/C# and when trying to hit enter
I'm trying to input a form of data validation in which when a user
Instead of adding teams one-by-one, I'm trying to create a form to enter a
Possible Duplicate: Stop Enter/Return key submitting a form I am trying to create a
I'm trying to submit a dialog form when the user presses enter. I had

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.