473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

List boxes and buttons, a great combo!

25
Hello everyone,

I've been working on this for a bit and wonder if anyone can shed some light on my situation. My ultimate goal is to have a user select an item in a list box, have one column in the list box display in either a text box or preferrably a button based on what is selected. The form is being used currently as a rudimentary document retrieval system. The document that is saved on a shared drive is linked in a table by a hyperlink, each document is saved for a specific person. I have it set up now where the user types in the persons name in a combo box, when they tab out of the box 4 columns appear in the list box from a query based on the name in the cmbbox, the 5th column not showing in the listbox is the hyperlink. I would like it be where the user will click on the row of the document they'd like to open, and preferrably have the button take them to the document via a hyperlink once pressed. I'm not sure if this is possible through a button. Or, a text box would work fine. I have been able to get the text box to populate the hyperlink with afterupdate in the list box, but it doesn't display the Text link that is set up in the table, only the location. I am extremely new to Access, but do somewhat understand queries, relationships and some of the code. Any help would be EXTREMELY appreciated, so far it's been trial and error, and I've been racking my brain and google on this one. Below are the names of the objects being used in the form currently:

Combo box where persons name is entered: cmb_cmdoc
List box where info from query displays, column the hyperlink is in is (5): lstDoc
Button I'd like to open link based on item selected in listbox: btn_docsearch
Text box that now displays link, but not in link format: txtDoc

Thanks again!!
Feb 6 '08 #1
7 1696
Minion
108 Expert 100+
Sorry I don't have more time at the moment to delve into this with you, but I did find something that may help in the mean time. For the text box you have displaying the hyperlink make sure that under format on the properties tab (last on one list) the property Is Hyperlink is set to "True" this should let the hyperlinks work if they are stored as hyperlinks in the table.

Hope this helps.

- Minion -
Feb 6 '08 #2
Clamato
25
Thanks Minion, I appreciate the help. I changed the option to yes for is hyperlink and it appears to be doing the same thing as before, except now the text is in blue as if it were a hyperlink and showing the full location address as opposed to the display text as it is in the table. But, still not in hyperlink format. :/
Feb 6 '08 #3
Minion
108 Expert 100+
I did a quick test and think I've found your problem. Goto the design of your table and make sure the field type is set to "Hyperlink" instead of "Text". If it's not set to a hyperlink Access seems to ignore it despite the form telling it is a hyperlink. Once this is set the text in table view should be blue underlined just like you'd expect.

Hope this helps.

- Minion -
Feb 6 '08 #4
Clamato
25
Thanks again Minion,

I do have the field in the table set as hyperlink as well. I wonder if it's the way the information is being passed to the text box. I have now on the list box where the user clicks the row they'd like to view and the column containing the link is passed to the text box as follows with an afterupdate:

Me![txtDoc] = Me![lstDoc].Column(4)

I think I'm really close to getting it to work with a button, I've added this on the button. I think my syntax may be a little askew:

Application.Followhyperlink Me![lstDoc].Column(4)

When I press the button it gives a hyperlink warning, but an error afterwords. What do you think?

Thanks!
Feb 6 '08 #5
Clamato
25
Alright, I got the button to work. I had to change the format of the hyperlink though, which means going through 150+ records and updating them :(

I think it may have had something to do with the "display text" in the link format, not sure why though. When I changed that to match the actual location I had the path display in the text box. Then I used

Expand|Select|Wrap|Line Numbers
  1. Private Sub btn_open_Click()
  2. On Error GoTo Err_btn_open_Click
  3.  
  4.     Dim stlink As String
  5.         stlink = Me![txtDoc]
  6.         FollowHyperlink stlink, , True
  7.  
  8. Exit_btn_open_Click:
  9.     Exit Sub
  10.  
  11. Err_btn_open_Click:
  12.     MsgBox Err.Description
  13.     Resume Exit_btn_open_Click
  14. End Sub
  15.  
on the button, so it's taking the string in the textbox as the link. GEESH! I have a lot of changing to do! Thanks for the help again Minion
Feb 6 '08 #6
MMcCarthy
14,534 Expert Mod 8TB
I believe you need to include display text to get a hyperlink to work consistently. Not sure why, probably just an MS bug.
Feb 6 '08 #7
Minion
108 Expert 100+
Glad that you go a least a part of it working. If you post a new thread with some of the details on what you have and what it has to be changed to I think we can come up with a quick script to help you out.

- Minion -

Alright, I got the button to work. I had to change the format of the hyperlink though, which means going through 150+ records and updating them :(

I think it may have had something to do with the "display text" in the link format, not sure why though. When I changed that to match the actual location I had the path display in the text box. Then I used

Expand|Select|Wrap|Line Numbers
  1. Private Sub btn_open_Click()
  2. On Error GoTo Err_btn_open_Click
  3.  
  4.     Dim stlink As String
  5.         stlink = Me![txtDoc]
  6.         FollowHyperlink stlink, , True
  7.  
  8. Exit_btn_open_Click:
  9.     Exit Sub
  10.  
  11. Err_btn_open_Click:
  12.     MsgBox Err.Description
  13.     Resume Exit_btn_open_Click
  14. End Sub
  15.  
on the button, so it's taking the string in the textbox as the link. GEESH! I have a lot of changing to do! Thanks for the help again Minion
Feb 7 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Brian | last post by:
Hope you all had a great holiday. I have a subform with a table with a combo box based on a select query. The combo box is set to display in a form in datasheet view. When I click the down...
2
by: CSDunn | last post by:
Hello, In an Access 2000 ADP subform, I have a set of two Radio buttons in a single group that are bound to a field called 'Completed'. The Completed field comes from an SQL Server 2000 table, is...
1
by: hartman | last post by:
I have seen things to link list boxes and/or combo boxes to forms such that when you select an item in the list (or combo) box the form moves to the matching record. One example (by Allen...
9
by: natwong | last post by:
Hi All, I'm a newbie in terms of Access and some of its functionality . I've been stuck on this problem for a couple days, even after searching the Web, etc. Currently I have five combo boxes...
2
by: saurabhnsit2002 | last post by:
Can anyone help me about how to create combo box with its items as checked boxes or radio buttons. This has to be done in C#. I have seen something similar to this named custom combo boxes but they...
1
by: favor08 | last post by:
I need help with a big project. I am struggle getting multiple option buttons and filters to work together. They need to be able to filter a subform. My first set of option buttons work fine all...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
2
by: RhysPhelps | last post by:
hi guys and girls, What i have is a list of account codes, and a list of cost centres. Each combination of these (so for example "5030" and "Externals") will have it's own budget reference...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.