Save user entry as part of a hyperlink, then display in subform (1 Viewer)

JaredXIII

New member
Local time
Today, 06:24
Joined
Nov 21, 2014
Messages
4
I'll do my best to explain my database without being too lengthy.

I have a form with multiple textboxes and comboboxes that allow for user entry, and a subform displaying a table, where the entries from the form are saved and can be retrieved. It's basically a way of creating new task entries and editing existing ones from a single interface.

One of the fields is an "issue number" of sorts, which is a 5-digit code that identifies the task. We have a website where details of each task are stored, and the URL format is akin to this: "httq://wvw.issuetracker.con/issues/code-[5-digit code goes here]". (random characters entered because I can't post a link) :p

The functionality that I'm hoping for is that when the user saves the record, it will be saved as the full link address, by concatenating the static first portion of the address and the code entered by the user. However, I need the table to still only display the code, not the whole link address, and will follow the full address when clicked in the subform table.

I've been trying to make this work but with no luck so far. Is this possible, and if so, what is the simplest solution?

Thanks very much!
 

Minty

AWF VIP
Local time
Today, 10:24
Joined
Jul 26, 2013
Messages
10,353
If you have the "issue number" you don't need to store the hyperlink. it's effectively a calculated result.

Store your current website address in a system table. If you ever change the web page design or even the domain you simply change the one field in your system table.

As for displaying it or linking to it from the form - Assuming it is on the form in a control called txtIssueNo try the following in a the on click event (Air Code Untested!)

Code:
Sub txtIssueNo_On_Click

Dim sWebPath as string
Dim sFullLinkPath as string

If IsNull(me.txtIssueNo) Then Exit Sub

sWebPath = "httq://wvw.issuetracker.con/issues/code-"  '[COLOR="YellowGreen"]Later on look this up from your system table[/COLOR]
sFullLinkPath  = sWebPath & me.txtIssueNo
Application.FollowHyperlink  sFullLinkPath 

End Sub
 

JaredXIII

New member
Local time
Today, 06:24
Joined
Nov 21, 2014
Messages
4
Thanks very much, that worked great! I figured there had to be a simpler way than storing it, so it could instead just process on the fly, and that is what you gave me! :D
 

Users who are viewing this thread

Top Bottom