Hello All,
Ok I've read it is not necessarily a good ideal to create a hyperlink
field in a database, but I've tried. I've also read that a hyperlink
field is a memo field with attributes of dbHyperlinkFiel d +
dbVariableField . So I tried using the code below, and received the error
below. Any ideals? Thanks!
,----- [ Error message on 'db.TableDefs.A ppend tdf' ]
| Run-time error '3010':
|
| Table 'Supplier' already exists.
`-----
=============== ======>Begin Code>========== =============== ==========>
Sub CreateSuppliers WithHyperLink()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Set db = CurrentDb()
Set tdf = db.CreateTableD ef("Suppliers" )
With tdf
.Fields.Append .CreateField("S upplierID", dbLong)
.Fields.Append .CreateField("C ompanyName", dbText, 40)
.Fields.Append .CreateField("C ontactName", dbText, 30)
.Fields.Append .CreateField("C ontactTitle", dbText, 30)
.Fields.Append .CreateField("A ddress", dbText, 60)
.Fields.Append .CreateField("C ity", dbText, 15)
.Fields.Append .CreateField("R egion", dbText, 15)
.Fields.Append .CreateField("P ostalCode", dbText, 10)
.Fields.Append .CreateField("C ountry", dbText, 15)
.Fields.Append .CreateField("P hone", dbText, 24)
.Fields.Append .CreateField("F ax", dbText, 24)
.Fields.Append .CreateField("H omepage", dbMemo)
For Each fld In .Fields
If fld.name = "Homepage" Then
Debug.Print "ok your in the loop"
fld.Attributes = dbHyperlinkFiel d + dbVariableField
End If
Next fld
End With
db.TableDefs.Ap pend tdf
Set fld = Nothing
Set tdf = Nothing
Set db = Nothing
RefreshDatabase Window
End Sub
=============== ======<End Code<========== =============== ==========<
--
Regards,
Greg Strong
Ok I've read it is not necessarily a good ideal to create a hyperlink
field in a database, but I've tried. I've also read that a hyperlink
field is a memo field with attributes of dbHyperlinkFiel d +
dbVariableField . So I tried using the code below, and received the error
below. Any ideals? Thanks!
,----- [ Error message on 'db.TableDefs.A ppend tdf' ]
| Run-time error '3010':
|
| Table 'Supplier' already exists.
`-----
=============== ======>Begin Code>========== =============== ==========>
Sub CreateSuppliers WithHyperLink()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Set db = CurrentDb()
Set tdf = db.CreateTableD ef("Suppliers" )
With tdf
.Fields.Append .CreateField("S upplierID", dbLong)
.Fields.Append .CreateField("C ompanyName", dbText, 40)
.Fields.Append .CreateField("C ontactName", dbText, 30)
.Fields.Append .CreateField("C ontactTitle", dbText, 30)
.Fields.Append .CreateField("A ddress", dbText, 60)
.Fields.Append .CreateField("C ity", dbText, 15)
.Fields.Append .CreateField("R egion", dbText, 15)
.Fields.Append .CreateField("P ostalCode", dbText, 10)
.Fields.Append .CreateField("C ountry", dbText, 15)
.Fields.Append .CreateField("P hone", dbText, 24)
.Fields.Append .CreateField("F ax", dbText, 24)
.Fields.Append .CreateField("H omepage", dbMemo)
For Each fld In .Fields
If fld.name = "Homepage" Then
Debug.Print "ok your in the loop"
fld.Attributes = dbHyperlinkFiel d + dbVariableField
End If
Next fld
End With
db.TableDefs.Ap pend tdf
Set fld = Nothing
Set tdf = Nothing
Set db = Nothing
RefreshDatabase Window
End Sub
=============== ======<End Code<========== =============== ==========<
--
Regards,
Greg Strong
Comment