[AccessD] Create Hyperlink Field in VBA

Joshua B lists at jbsolutions.com.au
Mon Jul 5 20:21:47 CDT 2004


Hi Group
			
Hoping someone can help me out here, I'm trying to create a Hyperlink Field in a table via VBA (Access 2K), the code looks like this...

'=====================Begin Code
Function addHyperlinkField(strDB as String)

Dim db As DAO.Database
Dim tbl As DAO.TableDef
Dim newfld As DAO.Field


Set db = OpenDatabase(strDB)

Set tbl = db.TableDefs("tbl_Clients")
Set newfld = tbl.CreateField("clnt_Website2", dbMemo, 233)
tbl.Fields.Append newfld
newfld.Attributes = dbHyperlinkField

End Function
'=====================End Code

The code bombs out on the last line and gives me Error 3219 - "Invalid Operation". If anyone has any ideas, it would be most appreciated.

Best regards.				 
Joshua B
lists at jbsolutions.com.au
www.jbsolutions.com.au
2004-07-06





More information about the AccessD mailing list