Unanswered: How to make a command button open specific hyperlinks in table fields
Hello, first time post: I've searched the previous threads and not found an answer which addresses my question directly. Hopefully there is sufficient detail below without blurring the question.
In an Access 2007 database form I want a command button to open specific/unique ID hyperlinks from a table field (within the database). Each form page displays unique ID entry from a table and the hyperlinks are specific to the form page/table entry. The hyperlink is not to a generic document but specific to each primary key ID table field entry that is being viewed in the form. The hyperlink opens documents located in a separate file store.
I have explored using the Expression Builder in Access but it appears it can only link to an Object in the database and not the table field entry specific to the data you are viewing on the form page.
Is the only way to achieve what I want by using SQL? I know very little about writing SQL so I would need help and any suggested SQL to achieve the command button function I want would be appreciated.
Unfortunately following the instructions in the linked previous post proved beyond me. In the end, the solution I arrived at was to keep the text/hyperlink boxes but make them invisible on the form. I then added the following code to the command button pointing to the hyperlinks:
Private Sub nameofcommandbutton_Click ()
If Me. [nameofcontrolsource]. Value = "" Then
MsgBox "Error: Reference path is blank"., vbCritical
FollowHyperlink Me. [nameofcontrolsource]. Value
I doubt it is best solution but one I was able to understand (just) and does open specific data as you move through individual records via the form.
I now can't work out how to display data from a link table in a listbox on a form. However I will open it in a separate post if I cannot find an existing suitable answer on the forum.
Not a problem at all and thanks for your suggestion. I'll try to revisit the solution in the pasted link at a later date but I need to take a dedicated SQL course at some point in order to understand it, otherwise it is litetrally like another language to me at the moment