?
Solved

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

Posted on 2003-11-25
7
Medium Priority
?
1,623 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
[X]
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
  • 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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 1500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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