Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Use data to create Hyperlink..?

Posted on 2000-03-14
8
166 Views
Last Modified: 2010-05-02
I want to know how it is possible to insert a search for a specific file.  At the moment I have a hyperlink to an Excel file called C:\Test\Test_01_01_2000.xls and another C:\Test\Test_02_01_2000.xls, basically every day a new file is created in the format. Test(filename)_01(day)_02(month)_2000(year).  What i would like to accomplish is to insert something like 3 text boxes on my form called ,day ,month and year.  Once the user inserted the data in the text boxes and you click the Submit button it should point to the relevant hyperlink. For example in the text box Day the user inserted 05 and the textbox month the user inserted 03 and textbox year the user inserted 2000, once inserted and you click the submit button the the results should the point to C:\Test\Test_05_03_2000.xls
0
Comment
Question by:fouchev
  • 4
  • 2
  • 2
8 Comments
 
LVL 43

Expert Comment

by:TimCottee
ID: 2615464
What are you using to create your hyperlink? The hyperlink will normally take the form of a string:

"file://c:/test/test_01_01_2000.xls" this could easily be built up as you describe.
0
 
LVL 1

Author Comment

by:fouchev
ID: 2615466
Edited text of question.
0
 
LVL 1

Author Comment

by:fouchev
ID: 2615477
Edited text of question.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:fouchev
ID: 2615498
Very quick there Tim,

Well at the moment the the hyperlink is under the properties of a command button called btnSubmit. Once I change the data in the text boxes, i need the hyperlink in the button properties to change accordingly.  Is this clearer?
0
 
LVL 2

Accepted Solution

by:
gelog earned 50 total points
ID: 2615676
Why do you use textboxes for date input? It is more elegant solution to use DateTimePicker (Calendar) Control.

Include to a project Windows Common Controls - 2. Place the DateTimePicker on the form, also add the button control.

Insert the following code to the from code module:

Private Sub Command1_Click()
    MsgBox Command1.Tag
End Sub

Private Sub DTPicker1_Change()
   
    With DTPicker1
        Command1.Tag = "C:\Test_" & Day(.Value) & _
            "_" & Month(.Value) & "_" & Year(.Value) & ".xls"
    End With
           
End Sub

Run the project, click on the buuton, you sould see the result in a message box.

0
 
LVL 43

Expert Comment

by:TimCottee
ID: 2615726
Are you using a DHTML project, VB Script or ActiveX document model to do this with? Gelog's comment is possibly helpful as it may well be a nicer interface to go with, however you would still have to format the date parts correctly to get "01" instead of "1" for the day and month.

0
 
LVL 1

Author Comment

by:fouchev
ID: 2619966
Hi again,
I works fine, it displays in the message box, but how do get it to go to the file (hyperlink) now. Must one put code behind the Ok button or what..?  
0
 
LVL 2

Expert Comment

by:gelog
ID: 2620073
Insert in the Global_Declarations section of the form code module the following API declaration:

Private Declare Function ShellExecute Lib "shell32.dll" _
    Alias "ShellExecuteA" _
   (ByVal hwnd As Long, ByVal lpOperation As String, _
    ByVal lpFile As String, ByVal lpParameters As String, _
    ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

In the Command1_Click event procedure insert the call of ShellExecute instead of the call of MsgBox:


ShellExecute 0&, "Open", Command1.Tag, 0&, 0&, 1&
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question