D
dbaker
This is a follow-up to what I posted Nov. 3, 2pm about
turning a table design view into its own dataview table.
A coworker is trying the response by Bogdan (I pasted it
at the very bottom).
Coworker:
Does anyone know how to get to the text value for the
description of a field in design view?
MS Access help says you have to use the CreateProperty
method, but that doesn't give you the existing value; it
just lets you define new ones.
Here's part of the adapted code from "Bogdan Zamfir"
<[email protected]> you showed me earlier:
'--------------------------------------
For Each fld In rs1.Fields
rs2.AddNew
rs2!FieldName = fld.Name
rs2!FieldType = fld.Type
rs2!FieldSize = fld.Size
rs2!FieldDescription = fld.CreateProperty(description,
dbText)
rs2.Update
Next
'
-------------------------------------
Thanks. Here's the original message:
Subject: Re: making table design into its own table
From: "Bogdan Zamfir" <[email protected]> Sent:
11/3/2003 3:12:06 PM
You should create the table with the fields you want:
Fieldname - text
Fieldtype - integer
Fieldsize - integer
Suppose you name it TableStruc
Then you should use a code as follows
dim db as database, rs1 as recordset, fld as field, rs2 as
recordset
set db = currentdb
db.execute "Delete from TableStruc" ' to be sure
you don't merge two
tables structure
set rs1 = db.openrecordset("YourTableName")
set rs2 = db.openrecordset("TableStruc")
for each oFld in rs.Fields
rs.AddNew
rs!FieldName = oFld.Name
rs!FieldType = oFld.Type
rs!FieldSize = oFld.Size
rs.Update
next
Regards,
Bogdan
_____________________________
Freelance developer
"(e-mail address removed)" <[email protected]>
wrote in message
news:[email protected]...
turning a table design view into its own dataview table.
A coworker is trying the response by Bogdan (I pasted it
at the very bottom).
Coworker:
Does anyone know how to get to the text value for the
description of a field in design view?
MS Access help says you have to use the CreateProperty
method, but that doesn't give you the existing value; it
just lets you define new ones.
Here's part of the adapted code from "Bogdan Zamfir"
<[email protected]> you showed me earlier:
'--------------------------------------
For Each fld In rs1.Fields
rs2.AddNew
rs2!FieldName = fld.Name
rs2!FieldType = fld.Type
rs2!FieldSize = fld.Size
rs2!FieldDescription = fld.CreateProperty(description,
dbText)
rs2.Update
Next
'
-------------------------------------
Thanks. Here's the original message:
Subject: Re: making table design into its own table
From: "Bogdan Zamfir" <[email protected]> Sent:
11/3/2003 3:12:06 PM
You should create the table with the fields you want:
Fieldname - text
Fieldtype - integer
Fieldsize - integer
Suppose you name it TableStruc
Then you should use a code as follows
dim db as database, rs1 as recordset, fld as field, rs2 as
recordset
set db = currentdb
db.execute "Delete from TableStruc" ' to be sure
you don't merge two
tables structure
set rs1 = db.openrecordset("YourTableName")
set rs2 = db.openrecordset("TableStruc")
for each oFld in rs.Fields
rs.AddNew
rs!FieldName = oFld.Name
rs!FieldType = oFld.Type
rs!FieldSize = oFld.Size
rs.Update
next
Regards,
Bogdan
_____________________________
Freelance developer
"(e-mail address removed)" <[email protected]>
wrote in message
news:[email protected]...