Display hyperlinks to a webpage in each cell as a button in Access 2010 - ms-access

I have a table in Access 2010 called Table1. Column NCBI contains hyperlinks to webpages. I would like to display each hyperlink as a button in each cell and the caption for that button to be the field value from the same row one column to the left, the column Gene.
Does anyone know how to accomplish this?

First you must have the table containing the website information. In my example I have a table called Websites. In the table there is two fields: URL which contains the direct URL such as http://google.com and WEBSITE_NAME which is simply the name of the website "Google".
Create the form however you would like it to look using whatever Default View that you would like, however make sure that the Record Source is set to the table containing the website name's and URL's. In my test one I used Datasheet.
On that form make sure at least the WEBSITE_NAME field is showing on form in a textbox, in mine I called it txtWEBSITE_NAME. There is a property that belongs to the txtWEBSITE textbox called Display as Hyperlink set that to "Screen Only".
Then go to the events tab of the txtWEBSITE, go to the On Click event and click the three dots and add this code to the sub procedure:
Private Sub txtWEBSITE_Click()
If Nz(Me.URL, "") <> "" Then
Application.FollowHyperlink Me.URL, , True
End If
End Sub
The Me.URL basically just says to use the URL that corresponds to the Website that was clicked. The Nz() function basically just checks to make sure that there is actually a URL that belongs to the website that was clicked.
You can add in your own error handling or validation checks but this is the barebones system that you can use to do what you were looking for.

Related

Hyperlink box (txtbox) on Access Form won't allow drop

I have a MS Access form that is bound to a query in the database. I added a textbox and added a row source to a Hyperlink datafield in the query. When I open the form, it won't allow me to drop a file into the textbox.
Here's the deal. When I follow this EXACT same process on a new form, it works perfectly. That is, I open a blank form and I bind the form to some new query, let's say qryNewIdeas. Then on the blank form i add a textbox, let's say Text0. Then, when I select Text0, I go to the data tab - row source and choose the dropdown arrow to select the hyperlink field, lets say NewIdeasAddress. I click SAVE and open the form. It works PERFECTLY.
BUT, when I repeat this on an existing form (the one where I need the thing to actually work), it does nothing. It adds and changes the textbox to a hyperlink box (I note this because of the blue underlined word that appears in the box). But it won't allow me to drop files to this location.
I tried commenting out ALL of my VBA code to try to make sure that something wasn't hindering it (say in an OnLoad event) AND I've checked all of the form and control box properties and they seem to be the same in both the existing form and the test form.
I can't determine why it works on one form and not the other; Solution needed.
If you have access to "the data tab - row source ..", you are in design view.
When you later open the form, you are in form view, a completely different animal which specifically prohibits design changes.
It sounds like you will have to rethink your concept.

DOM - Select Value from a Field that has a Search Component and a Drop Down

I have been working on this forever. I have attached a first picture of the steps I am trying to do in VBA. This particular field that I have having trouble populating for a client of mine appears to be a drop down but when you click it, it has a search field. I know the option value I want the field to be set to but using doc.getElementbyID("id_referrer").selectedIndex = fieldValue is not working. See the first picture for the steps of what I'm trying to do, then the second picture for the behind the scenes look at the classes and then all the different commands that I've tried to populate this field. The save button works, but nothing ever is populated for the Referrer or it bombs.

Query return hyperlinks in text fields in Microsoft Access 2010

How to return data table`s text fields as hyperlinks to open the detailed view thereafter: all fields of the search item in Microsoft Access 2010? Similar to ASP.NET GridView with column hyperlinks.
Thanks
As far as i understand, you are having a datasheet and would like to click on each ID to open the full details.
idea:
make a field act as a hyperlink
build a new form to show the full details
use the onClick event to open a new window with your full details
To achieve this:
you need to create a new form where your full details will be showed. I guess you know this already. in case:
select the table/query you are trying to use as datasource for the
Form.
goto menu > create > Form ( this will create a default form with all fields in your table/query)
Save the from "frm_view_in_full"
Goto the main DataSheet/gridview from where you would like to call this form
select the field you would like to make it hyperlink and goto the field's properties.
set the fields property "is Hyperlink = Yes"
goto the on event property for the selected field
now you can simply call the form with where condition like:
docmd.OpenForm "frm_view_in_full", acNormal,,"[whereConditionField]=" & Condition

hyperlink doesn’t work in Access form

I have an Access form in which I am unsuccessful in formatting the record to be in hyperlink format.
The form is in datasheet-view format, which contains records with a link to a website. The form’s datasource is a select-query. The hyperlink is created with the following expression, which concantenates text and data, in order create a web link :
"#http://www.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_us&InquiryNumber1=" & [T].[tracking_number] & "&track.x=0&track.y=0#"
I tried setting the property-sheet format field to “hyperlink” , but it automatically changes to “hy"perli"n\k”, in both the query-design view, and form-design-view.
please advise what I need to do in order to have the form output the records in hyperlink format, so I can just click on the website link and it will open up in a web browser
thanks very much in advance,
Nathaniel, Access 2007
You can use the IsHyperlink property for the textbox (format tab) , once again, these are a nuisance to edit. If you create a form based on a table with a hyperlink field, the control created for the hyperlink field will be set up as a link.
More on IsHyperlink: http://msdn.microsoft.com/en-us/library/aa196153(office.11).aspx
Paste something like this into the textbox to see it working:
clickme#http://www.ups.com/WebTracking/processInputRequest?sort_by=status&tracknums_displayed=1&TypeOfInquiryNumber=T&loc=en_us&InquiryNumber1=123456&track.x=0&track.y=0#

MS Access linking combo box to form

I'm trying to link a field, which I have a drop down box in, to a form. I have a list of about 10 forms to pick from. I'm sure this is simple, but I'm just overlooking the obvious.
Simple example code for the opening from the EventName() event (change EventName based on what event you are using):
Private Sub Combo0_EventName()
If Combo0.Value = "Form1" Then
DoCmd.OpenForm "Form1", , , acFormAdd, , , stLinkCriteria
ElseIf Combo0.Value = "Form2" Then
DoCmd.OpenForm "Form2", , , acFormAdd, , , stLinkCriteria
End If
End Sub
Depending on what you are trying to do will determine the event to use, but running the open form command in that event based on the combo box value will get you where you need to go.
Let me understand this right, you have a form with a combo box. When the user selects an option from the combo box, one of 10 other forms open?
How about, in the On Change Of event of the combobox, open the second form?
To clarify:
You open up Access and are presented with a form that contains a combo box filled with some values. You select one of the values and want to bring up a different form and then fill that form out based on some criteria.
The sub routine Combo0_EventName() will take care of opening a form based on the field you select, just put the code in the Combo0_AfterUpdate() routine. To get to that right click on the combo box in design view and select Properties, then click in the "AfterUpdate" event to get [Event Procedure] to show up then click the ... button to get the VB editor.
If you want to fill out the form you open up automatically the method depends on what you are trying to do. You probably want to have another combo box on the first form or on the other forms you are opening that allows you to select your query parameters. Lets say you are opening a form that displays someone's address. You would want a combo box on that form to select from the names in your table and when you select a name it would update a textbox with the address information. Or you could put your query parameter selection on the main form and tie that data to all of the forms so you can go through the forms with the same entry in the table, useful for something like order entry.
If that sounds like what you are trying to do we can move forward down that path, or if it is not please clarify. Can you describe an example of what you are doing? That would be helpful.
I'm sure we can get you going with this.
Im trying to make local tax forms. We do several different local forms and just want the person perparing the return to be able to put in the basic information in a form, which will then automatically pop up which form they are to use, completely filled in. This way all they have to do is enter the basic info in a standard sheet and the local form automatically gets completed. I have made it so when i person picks the municipality from the drop down box it automatically list the form name it needs to go in. But i want it to be simpler than that for them. NE Suggestions?
That makes sense, each form probably has different tax codes, addresses, etc. on it.
I'll see what I can do over the next couple days and set you up with something to get you going.