Results 1 to 11 of 11
  1. #1
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188

    Drop Down Plus Navigation

    I have a drop down "VendorSku" on my form with a query source. Defaults to first value. Works great.



    How can I add buttons as an optional way to navigate through the drop down? Neither the standard form navigation or the navigation buttons I added with navigate through the drop down list. It would be convenient for the user to click through instead of having to drop down each time.

    Thanks!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Not really understanding what you want. How would buttons navigate (scroll ?) a combobox drop down list?

    Code can cause list to automatically drop down when combobox gets focus. Typing in combobox 'navigates' by applying AutoExpand feature.
    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
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188
    Imagine your typical select state drop down. You can optionally use arrow keys to get the previous and next value without having to drop down. My drop down does not change with arrow keys or navigation buttons. Just trying to give the user an option. In this case, the drop down provides values for 3 more subforms. Additionally, they will have view all values in the drop down to finish the task. There's 10 or so values.

    Thanks

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    "typical select state drop down" - typical where?

    Access combobox list must drop down for cursor keys to work.

    Private Sub cbxState_GotFocus()
    Me.cbxState.Dropdown
    End Sub

    Or use a listbox.
    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.

  5. #5
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188
    "typical select state drop down" - typical where?
    Go to this page for a typical drop down:
    https://wholesaledropship.com/reg.asp

    You can drop down or use arrow keys for previous and next records. It's ASP and not MS Access, but this is what I mean by typical drop down.

    Thanks!

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    5,007
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,991
    Exactly the same occurs with an Access combo. Once the dropdown is visible the up/down arrow keys move the cursor position.
    It also works for a listbox.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  8. #8
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188
    Quote Originally Posted by isladogs View Post
    Exactly the same occurs with an Access combo. Once the dropdown is visible the up/down arrow keys move the cursor position.
    It also works for a listbox.
    Correct, in that once you drop it down, arrows work. But in the ASP sample I provided, you don't have to drop it down. You can tab to it from the city box and use arrow keys without dropping it down. I guess it's just the difference between ASP and Access.

    Thanks for your help!

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Okay, point taken. AFAIK, Access combobox will not allow that. Access form and its controls is not a web page. I have never run across code trying to emulate this. That could mean trapping the up/down cursor key presses with KeyDown event, increment the row position with each cursor press and of course, if they press up arrow, reduce the position. Or instead of trapping key presses, maybe your idea of up/down command buttons could be applied, although a form in datasheet view will not allow that.

    Simple to just open list. Did you see and try code in post 4?
    Last edited by June7; 04-09-2022 at 05:36 PM.
    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.

  10. #10
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,991
    I'm still unclear why buttons are being suggested to change something that already works in a simple way into something unnecessarily complex.

    If you use a listbox, it is possible to 'select' a record just by moving the mouse up /down over the list without clicking.
    A listbox is always dropped down and the mouse move code makes navigation very simple.
    Your only restriction is that the listbox must show all records with no scrollbar.

    If that idea sounds interesting, you can see it in action in Forms 4 & 5 in my example app https://www.isladogs.co.uk/move-form...ols/index.html
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  11. #11
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    Not that I think it's practical to go line by line through a combo list rather than drop it down and use scrollbar to advance row by row or page by page, but you could use keydown (I think down arrow is key 40) and advance the combo list index value, as in

    Me.myCombo.ListIndex = Me.myCombo.ListIndex + 1

    Of course, more code would be needed to back up in the list, as well as trap for being at the beginning or end of a list. Big pain for small gain.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 40
    Last Post: 04-06-2020, 06:49 AM
  2. Replies: 5
    Last Post: 03-02-2015, 02:14 PM
  3. Replies: 1
    Last Post: 02-20-2012, 10:56 PM
  4. Replies: 3
    Last Post: 12-30-2011, 01:20 PM
  5. Replies: 3
    Last Post: 11-29-2011, 07:01 AM

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