Solved

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

Posted on 2003-11-25
7
1,604 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
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…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

920 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

17 Experts available now in Live!

Get 1:1 Help Now