• Text Box ?? (Access 2000/XP)

    Author
    Topic
    #358760

    My database will store information regarding CAD drawings…it won’t store the drawings, just provide information about the drawing. One peice of information would be the path to the CAD file.

    In a bound textbox the user will input the path. I have inserted the first part for them…i.e. “C:”. When the user enters this control, I want the cursor position to be after the “”. What do I need to do to accomplish this?

    Thanks,

    Viewing 0 reply threads
    Author
    Replies
    • #536002

      Hi Roberta,

      I’ve had the same need in several projects. I’ve discovered the easiest way to enter path info is to use a Browse for Folder dialog. The Access Web has several examples of API calls to browse both for folder and for a specific file. I’ve even taken a snapshot of the Windows Explorer icon and used that on a button next to the text field. The users LOVE it!

      API used to scare me! However, these examples are such that you can paste them into a module and they’re ready to run.

      Here is a link to the Browse for Folder Dialog function
      Here is a link to the Open/Save As… Dialog

      Post back if you need further assistance.

      HTH thumbup

      • #536003

        Mark,

        One word…WOW!!!!

        To take it a step further, how can I store that information in the bound txtbox?

        Thanks,

        • #536006

          Hi Roberta,

          Since the Browse function returns a string, all you would need is a custom function speficying the control name (i.e. bound Text box) so that you could use the custom function from any control in the database.

          All you need to do is enter the function name (with control name and Title string as arguments) in the OnClick event of your button:

          Function OpenBrowseDlg(ctl as Control, strTitle as String)
              Dim strPath as String
              strPath = BrowseFolder(strTitle)
              If strPath  "" Then
                  ctl.Value = strPath
              Else
                  Exit Function
              End If
          End Function

          In your OnClick event, you would have something like: =OpenBrowseDlg(txtMyPath, “Select a path for “)

          HTH thumbup

    Viewing 0 reply threads
    Reply To: Text Box ?? (Access 2000/XP)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: