Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Text Box ?? (Access 2000/XP)

    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,
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Box ?? (Access 2000/XP)

    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 <A target="_blank" HREF=http://www.mvps.org/access/api/api0002.htm>Browse for Folder Dialog function</A>
    Here is a link to the <A target="_blank" HREF=http://www.mvps.org/access/api/api0001.htm>Open/Save As... Dialog</A>

    Post back if you need further assistance.

    HTH <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Box ?? (Access 2000/XP)

    Mark,

    One word...WOW!!!!

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

    Thanks,
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Text Box ?? (Access 2000/XP)

    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:<pre>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</pre>

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

    HTH <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •