Solved

Access 97 How to Define the Field Type with a create table query to be Hyperlink

Posted on 2003-11-25
7
1,602 Views
Last Modified: 2010-08-05
Access 97
I am using a make table query to create a list of hyperlinks to files stored on a remote server.
When I run this query it creates the new table, but the new field is of the type text.
How do I get the Query to create this new table but have the field type as a hyperlink instead of just text?

I have a record type called STOCKNO
STOCKNO is a text field similar to the following:
DK-12345JV

I am extracting  the first two characters and then only the numeric portion of this field  DK12345 and creating a link to a word documet in the form of

j:\sales\quotes\writeups\DK12345.doc

I would like this to then be stored in a new table as a hyperlink.

here is the Expression I am using...

link: "j:\sales\quotes\writeups\" & Left$([STOCKNO],2) & Val(Right$(Trim$([STOCKNO]),Len(Trim$([STOCKNO]))-InStr(Trim$([STOCKNO]),"-"))) & ".doc"

this creates a new field called link in the new table

This works as expected, but when the new table is created the field is of the type text.

where or how do I get the query to create a field of the type Hyperlink instead?
0
Comment
Question by:vpcnc
  • 4
  • 2
7 Comments
 
LVL 32

Expert Comment

by:jadedata
ID: 9819345
Hey vpcnc!

  There is no "hyperlink" property on a table.  
  You can simple store the hyperlink value then you can use the FollowHyperlink method to fire the hyperlink.

  I'm thinking there should be a form involved here somewhere also,....

regards
Jack
0
 
LVL 1

Author Comment

by:vpcnc
ID: 9819401
Thanks Jack...

When I Manualy create a new table I can select Hyperlink as one of the field types.
So there should be a way to create this field type using a Make table Query...

I will even fore go the Make table query for a Access Basic Module that will complete the same task...

the only requirement is that the new table must have this field definde as a hyperlink and not just as text...

George
0
 
LVL 32

Expert Comment

by:jadedata
ID: 9819438
I lied.... Its the datatype itself (as you can tell...) sorry to mislead.

Instead of a make table, how about appending to a pre-built template table?
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 32

Expert Comment

by:jadedata
ID: 9819445
I am trying to locate the datatype constant for the hyperlink field type,...
0
 
LVL 32

Expert Comment

by:jadedata
ID: 9819451
For tables where the make table query is just too simple...
I build the table the way I want it and append into it with a query.

docmd.copyobject will create the new unfilled version
docmd.execute "AppendQuery", dbfailonerror,... will fill the new copy of the table.
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
ID: 9820546
As I understand it Jet knows nothing about Hyperlinks.  A hyperlink field is really a memo field with an <Access> interpretation applied to it.
If this is correct, then you will not be able to create a hyperlink field in JET SQL.  

To create a hyperlink field in code you can use the following example as a guide.
This code creates a table with a single field which is a hyperlink.

Pete


    Dim db As DAO.Database
    Dim tdf As DAO.TableDef
    Dim fld As DAO.Field

    Set db = CurrentDb
    Set tdf = db.CreateTableDef("Tablename")
    Set fld = tdf.CreateField("MyHyperlink", dbMemo)
    fld.Attributes = dbHyperlinkField
    tdf.Fields.Append fld
    tdf.Fields.Refresh
    db.TableDefs.Append tdf
    db.TableDefs.Refresh
    Set fld = Nothing
    Set tdf = Nothing
    Set db = Nothing

 
0
 
LVL 1

Author Comment

by:vpcnc
ID: 9820745
Pete

Thank you for your explanation and example...
I think my answer relies on using a combination of your reply and jack's repy

I can use your Create Table method initially and then use an append query to append the Hyperlinks.

So how do I go about awarding these points?

 
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now