Results 1 to 8 of 8
  1. #1
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165

    Emulate MS Explorer Address Bar Buttons

    I've got a table that represents a hierarchal relationship. It would be nice if I could build a navigation bar to move back in a tree. I have the microsoft explorer address bar buttons in mind like so:

    Click image for larger version. 

Name:	Untitled.png 
Views:	28 
Size:	10.2 KB 
ID:	52472


    Each directory in the address bar is clickable to jump straight to an ancestor. Generating the path is easy enough, my question is what would be the most straightforward way to create an horizontal address bar like that with multiple functional links to other records? I need a horizontal list box!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Buttons and code to navigate and modify captions?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    it's not that difficult - but depends on your data and the actual requirement.

    Assuming you are talking about a directory path -use the split function to get each element into an array then loop through the array to populate a row of buttons, labels or text boxes, and hide any surplus ones.

    You may need additional code to adjust the width of the control to accommodate the length of the text

    So code might be something like this with textboxes named txt0, txt1, txt2 etc - say you have 20 of them

    Code:
    dim s() as string
    dim i as integer
    dim Lft as long
    
    'reset controls
    for i=0 to 19
        me("txt" & i).left=0
        me("txt" & i).width=0
    next i
    
    s=split(myPath,"\")
    Lft=0
    for i =0 to ubound (s)-1
      
        me("Txt" & i)=s(i)
        me("Txt" & i).left=Lft
        me("Txt" & i).width=3000
        lft=lft+3000
    
    next i

  4. #4
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    A bunch of button controls was my first thought as well. I suppose i was hoping I wouldn't have to reinvent the wheel.

    Can cmd buttons be resized with an autofit?

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    Can cmd buttons be resized with an autofit?
    you can use one of the wizhook functions

    Code:
    dim s() as string
    dim i as integer
    dim Lft as long
    Dim lh As Long
    Dim lw As Long
    
    'reset controls
    for i=0 to 19
        me("btn" & i).left=0
        me("btn" & i).width=0
    next i
    
    WizHook.key = 51488399
    
    s=split(myPath,"\")
    Lft=0
    for i =0 to ubound (s)-1
      
        with me("btn" & i)
          .caption=s(i)
          .left=Lft
          WizHook.TwipsFromFont .FontName, .FontSize, .FontWeight, .FontItalic, .FontUnderline, 0, s(i), 0, lh, lw
          .width=lw 'may want adjust further for images and margins if used
          lft=lft+.width
    
       end with
    
    next i

  6. #6
    Edgar is offline Competent Performer
    Windows 8 Access 2016
    Join Date
    Dec 2022
    Posts
    309
    I don't have a sample but the Toolbar control MIGHT be an interesting solution to the Windows' "breadcrumbs control". In fact, since the buttons of the Toolbar control have dropdown capabilities, it MIGHT be ideal. A web browser control solves this too, with ease.

    You'd have to learn to use either of them programmatically, though.
    Just my 2c.
    Please click on the ⭐ below if this post helped you.


  7. #7
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    Toolbar control is an interesting idea! I'll look in to it. I had actually considered a series of combos instead of buttons so I could utilize the dropdowns as menus

  8. #8
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    Thanks for the wizhook suggestion. I haven't played with those functions yet. I just found isladogs write up on his website... thanks for the homework

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Is there a Search Bar for the Project Explorer
    By Paul H in forum Programming
    Replies: 5
    Last Post: 05-30-2018, 02:36 PM
  2. Can I Make Access DCount Emulate Count?
    By tgall in forum Forms
    Replies: 8
    Last Post: 02-10-2016, 08:25 AM
  3. Emulate Excel VBA in Access
    By JohnBoy in forum Programming
    Replies: 14
    Last Post: 02-23-2010, 06:44 PM
  4. Replies: 1
    Last Post: 10-07-2009, 08:15 AM
  5. Input Mask for an IP Address and Mack Address
    By baksg1995 in forum Access
    Replies: 18
    Last Post: 06-23-2009, 12:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums