Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    tholden is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2020
    Posts
    14

    Listbox, right click list to....


    I have a listbox with data filtered from a query, Id like to be able to right click on this listbox and open hyperlinks that are displayed. It would be great if i could right click and do other functions, im not sure how powerful this can be. Im not a coder ive been building my companies database thru macros and so far so good. Any help is appreciated thanks!

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Any particular reason why right click? You would likely need a custom shortcut menu, and while not impossible, they are difficult for a novice to create, maintain and modify. Could you not just use a double click action on the selected row? Something like

    Private Sub ListNameHere_DblClick(Cancel As Integer)
    Application.FollowHyperlink Me.ListNameHere
    End Sub
    If there is more than one column, use the zero based column reference: Me.ListNameHere.Column(1) for column 2.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    tholden is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2020
    Posts
    14
    doubleclick would work! ill give that a try, appreciate the quick response!

  4. #4
    tholden is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2020
    Posts
    14
    The column, as you can see is called PDF and it is from a query and is, column 7, i tried double clicking, no luck, did i type the code incorrectly? thanks! Click image for larger version. 

Name:	]]].PNG 
Views:	13 
Size:	53.6 KB 
ID:	42660nClick image for larger version. 

Name:	[[[[.PNG 
Views:	13 
Size:	54.2 KB 
ID:	42659

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    did i type the code incorrectly?
    Me thinks so. Did you miss the part where I said the column order is zero based? Try inserting a message box (temporarily) to report the column value, or debug.print it:
    Msgbox Me.ListNameHere.Column(7)

    AND

    ListNameHere is supposed to be the name of your listbox.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Try
    Code:
    Private Sub List308_DblClick()
    
         Application.FollowHyperLink Me.List308.Column(6)
    
    End Sub

  7. #7
    tholden is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2020
    Posts
    14
    oh no i had something bad happen when i did this code.....im getting this error now on my database....how do i fix this? it wont let me open anything without the 'ID' is noit an index in this table error............ >.<

    Click image for larger version. 

Name:	'''.PNG 
Views:	12 
Size:	9.6 KB 
ID:	42661Click image for larger version. 

Name:	;;;;.PNG 
Views:	12 
Size:	5.5 KB 
ID:	42662

  8. #8
    tholden is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2020
    Posts
    14
    if i send my database file to someone can they fix it? this looks bad...

  9. #9
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Dont panic.
    Which code did you try?

    Do a compact and repair and see what happens.
    There are probably 2 files now, ones a backup.

    you can post your db here.

  10. #10
    tholden is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2020
    Posts
    14
    i have cloud backup, got my server from yesterday, no problem, i will try the code again, appreciate the help all

  11. #11
    tholden is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2020
    Posts
    14
    tried the new code, works great! thanks so much moke123

  12. #12
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  13. #13
    tholden is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2020
    Posts
    14
    thats a scary bug....when i get this database complete its going to live on our local network and get accessed by 8ish people at a time, is there a way to make the database more robust so bugs and crashes etc cant happen?

  14. #14
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,643
    Hey Micron,
    There's been a few posts about that recently, hasn't there?

  15. #15
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    thanks so much moke123
    Anyone can give you a fish - I try to let others learn to catch their own, although I cannot say that I stick to it religiously.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 11-19-2015, 03:05 PM
  2. Double Click Listbox
    By HelpDesk in forum Access
    Replies: 12
    Last Post: 06-29-2015, 10:38 AM
  3. prevent deselect items in the listbox after right click
    By masoud_sedighy in forum Programming
    Replies: 1
    Last Post: 08-13-2013, 01:06 AM
  4. How to Restrict the Listbox on double click
    By ganeshvenkatram in forum Access
    Replies: 2
    Last Post: 07-07-2011, 10:05 PM
  5. Rescrolling in ListBox on Double Click
    By jackkent in forum Access
    Replies: 6
    Last Post: 09-28-2010, 11:56 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