Creating Label Hyperlinks

NeroMaj

Registered User.
Local time
Today, 12:14
Joined
Sep 13, 2010
Messages
34
I have a dashboard program with a "navigation" menu on the left. This "navigation" menu has labels that are filled in at runtime with one field of a recordset.

I want each label that is filled in to then link back to the record it represents. Is this possible to do, and if so, what is the procedure.

I have looked at the label object, hyperlink property, and i can't find a good example of how to link it (in code) to a single record.
 
What version of Access are you using?

At first glance I would try this:

1) when the labels are "filled in at runtime with one field of a recordset" I would set the Tag property to be the record's primary key value.

2) for each label set the hyperlink to a space (=" " ). This will make it appear as a hyperlink.

3) use the on click event to run VBA code to open the desired form that is filtered to the vaule in the Tag property.
 
At first glance I would try this:

1) when the labels are "filled in at runtime with one field of a recordset" I would set the Tag property to be the record's primary key value.

Hello HiTechCoach! I am a life-long 'Newbie-intermediate" developer. I am finally getting over some mental blocks about Relationships and starting to understand how to lay out tables, etc., so forgive me if my question is remedial, but in the above statement, did you mean to set the Tag property of the resulting recordset of labels that were generated at run time? How would one set the Tag property of a generated recordset or a filtered recordset? :(

Thanks!
 
I was referring to the Tag property of the label. You could use the TAG property of the label as a way to " link back to the record it represents."
 
I was referring to the Tag property of the label. You could use the TAG property of the label as a way to " link back to the record it represents."

Thanks for your quick reply. Actually I knew you were referring to the Tag property of the label. My question is in the case of your answer, why use the Tag property? Why not just use the PK itself? Again, my sincere apologies if this is a terribly remedial question. Thanks for answering.
:)
 
Thanks for your quick reply. Actually I knew you were referring to the Tag property of the label. My question is in the case of your answer, why use the Tag property? Why not just use the PK itself? Again, my sincere apologies if this is a terribly remedial question. Thanks for answering.
:)

You would be using the PK.

The ideas was to use the the TAG property to store the PK. This would give the label a "link back to the record it represents" which is what you ask for originally when you said:

I want each label that is filled in to then link back to the record it represents.
 
Oh sorry. I'm not the original poster, but this is something that I was following too. Thanks again.
 
Maybe I do not understand what you mean by the label having a link back to the record.

Can you example in more detail what you are wanting to do?

If you can't post a sample of the database then a screen shot would help.
 
Oh sorry. I'm not the original poster, but this is something that I was following too. Thanks again.

I did not notice that you were not the OP.

I am glad to explain my suggestion of using the tag property.

Do you still have any questions?
 
Thank you. In fact, I was wondering how I might automatically assign the PK to the Tag property? Could I just use some code on Form Load that would make the Tag property equal to the PK field? Or I presume you have a better way to auto assign the PK to the Tag property?

Also, once it's assigned, how would you specify that the hyperlink should use the Tag property as the destination?

Thank you very much for your time.
 
Thank you. In fact, I was wondering how I might automatically assign the PK to the Tag property? Could I just use some code on Form Load that would make the Tag property equal to the PK field? Or I presume you have a better way to auto assign the PK to the Tag property?

Also, once it's assigned, how would you specify that the hyperlink should use the Tag property as the destination?

Thank you very much for your time.

You will have to use VBA code to do it triggered somewhere.

Hyperlink? If you want a hyperlink the you could skip the TAG property and use the Hyperlink property.

When the OP said link, I was not taking that as meaning a hyperlink. I have not yet tried to used hyperlinks to navigate withing Access. I do make what looks like a hyperlink to the user, but it really runs VBA code when clicked.

Are you wanting to do the same thing as the OP?

If it were me I would not be using labels and a bunch of code to load them. . I would be using a sub form with text boxes. All that can be code with no VBA code. I would use a little VBA code to open a form to the record that matches.
 
Hyperlink? If you want a hyperlink the you could skip the TAG property and use the Hyperlink property.

When the OP said link, I was not taking that as meaning a hyperlink.

Sorry, I thought the title of the post was 'Creating Label Hyperlinks'? Perhaps I am just confused.
;)
I think I have a handle on the idea. Thanks for your help anyway.
 
Sorry about that. Bad habit. I normally don't look at the subject line. After reading over 100,000's (really! I have also posted over 25,000 replies on forums about Access) post I find most of the time the subject line is not very meaningful/useful to the actual post. I just look for posts that have zero replies and read the post.
 

Users who are viewing this thread

Back
Top Bottom