none
Problem With Text Box RRS feed

  • Question

  • Windows 10 Pro x64
    Access 2010

    I have a simple form that is used to select a directory.  The form has two controls:
    txtCurrentDirectory and cmdBrowse.
    gsRootDirectory is defined as: Dim gsRootDirectory as string
    vFolder is defined as: Dim vFolder As Variant

    The code under cmdBrowse is:
        txtCurrentDirectory.SetFocus
        Set fd = FileDialog(msoFileDialogFolderPicker)
        fd.Title = "Select Root Directory For Search"
        fd.InitialFileName = ""
        fd.InitialView = msoFileDialogViewDetails
        fd.Show
        If (0 < fd.SelectedItems.Count) Then
            For Each vFolder In fd.SelectedItems
                gsRootDirectory = vFolder
            Next vFolder
        End If
        Set fd = Nothing
       
        txtRootDirectory.SetFocus
        If (0 < Len(gsRootDirectory)) Then
            txtRootDirectory.Text = gsRootDirectory
        Else
            gsRootDirectory = txtRootDirectory.Text
        End If

    At the end of this process txtRootDirectory.Text has a <div> at the beginning and end of the string.  It ends with: images\2011\09\12\arts\music\12artsbeat-winehouse-bennett</div>

    Why is there a <div></div> wrapping txtRootDirectory.Text?


    http://www.saberman.com

    Wednesday, March 28, 2018 4:42 AM

All replies

  • What type of control is txtRootDirectory?  Plain Text, Rich Text?

    Daniel Pineault, 2010-2017 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    Wednesday, March 28, 2018 10:10 AM
  • Sorry, but I removed the control from the form.  I cannot reproduce the problem with the replacement form.

    http://www.saberman.com

    Wednesday, March 28, 2018 3:49 PM
  • Hello saberman,

    >>Sorry, but I removed the control from the form.  I cannot reproduce the problem with the replacement form.

    What's the current state of the issue? If you removed the control, the code must be updated. What's the current code?

    I had tried to created a text box for testing your original code and there is no issue for us to show the selected folder path. I would suggest you try to repair office to check if the issue still exist.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, March 29, 2018 2:26 AM