Need Help Setting Hyperlink to Open Different Forms/Reports Dynamically (1 Viewer)

turkster4u

New member
Local time
Today, 08:34
Joined
Oct 18, 2014
Messages
3
I am most likely considered an advanced novice to programming in VBA.

I am trying to add a feature in my database dashboard that shows a list of hyperlinks that are the most frequently used forms and reports based upon the user. I can figure out how to capture the event each time the form or report is opened and update a record to increase the count, and build a recordset that will query the table filtering by user and order by frequency...

However, I am stuck on building the hyperlinks that will point to the correct form or reports dynamically.

Specifically, I am not able to update the subaddress using VBA. I get an error that the hyperlink cannot follow to the new form... Im sure it's just a syntax issue...

Here is my code: (its just for experimenting with right now)

Code:
Private Sub Form_Load()

Dim strUser As String
Dim strApp As String


strUser = Environ("username")
strApp = "frmTest1"


Me.txtUser = strUser
Me.txtLink3 = strApp
Me.txtLink1 = strApp
Me.hypTest.Hyperlink.SubAddress = strApp
    

End Sub
Any help would be appreciated!
 

boerbende

Ben
Local time
Today, 16:34
Joined
Feb 10, 2013
Messages
339
Maybe something similar to a switchboard?
Create a switchboard with all your forms and look at table switchboarditems
The order in column itemnumber do you want to reorder based on the number of clicks on this by a specific user. So you still need to register the userclicks, but this is what you do already (as I understand)
 

turkster4u

New member
Local time
Today, 08:34
Joined
Oct 18, 2014
Messages
3
No, it needs to be hyperlinks. because it is a feature of a dashboard not the primary object as a switchboard would be.
 

turkster4u

New member
Local time
Today, 08:34
Joined
Oct 18, 2014
Messages
3
I figured it out myself guys. If anyone is trying to do the same thing, I had to add "Form" in front of the form name.

eg.
Code:
Private Sub Form_Load()  Dim strUser As String Dim strApp As String   strUser = Environ("username") strApp = "Form frmTest1"   Me.txtUser = strUser Me.txtLink3 = strApp Me.txtLink1 = strApp Me.hypTest.Hyperlink.SubAddress = strApp       End Sub
Hope this helps anyone else that may try something similar...
 
Last edited:

Users who are viewing this thread

Top Bottom