• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1635
  • Last Modified:

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

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
vpcnc
Asked:
vpcnc
  • 4
  • 2
1 Solution
 
jadedataMS Access Systems CreatorCommented:
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
 
vpcncAuthor Commented:
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
 
jadedataMS Access Systems CreatorCommented:
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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
jadedataMS Access Systems CreatorCommented:
I am trying to locate the datatype constant for the hyperlink field type,...
0
 
jadedataMS Access Systems CreatorCommented:
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
 
peter57rCommented:
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
 
vpcncAuthor Commented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now