Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete/Modify Field Property 2

Status
Not open for further replies.

Pampers

Technical User
Apr 7, 2004
1,300
AN
Hi Everyone,
Question about a Field Property. I can create a Field Property (see code), but how can I modify or delete an existing property??

Code:
Dim tdf As TableDef
Dim curDatabase As Object
Dim fld As Object
Dim prp As DAO.Property

'Get a reference to the current database
Set curDatabase = CurrentDb

'Get a reference to a table named Customers
Set tdf = curDatabase.TableDefs("BOD01_Artikelgroepen")

'Create field
Set fld = tdf.CreateField("OpslagTransAruba9", dbDouble)
tdf.Fields.Append fld

'Properties Field
Set prp = fld.CreateProperty("Format", dbText, "Fixed")
fld.Properties.Append prp

Set prp = fld.CreateProperty("DecimalPlaces", dbByte, 4)
fld.Properties.Append prp


Set fld = Nothing
Set prp = Nothing

Pampers [afro]
Keeping it simple can be complicated
 
No F1 key on your keyboard ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV,
Sure, pressed it about 50 times.

collection.Delete objectname

I will give it another try

Pampers [afro]
Keeping it simple can be complicated
 
As far as I recall, these properties are read-only in VBA, however, DDL may suit:

strSQL = "ALTER TABLE Table1 ALTER COLUMN Field1 DateTime"
CurrentDb.Execute strSQL

 
Thx Remou,
It can be delete (after reading):
Code:
Dim tdf As TableDef
Dim curDatabase As Object
Dim fld As Object
Dim prp As DAO.Property

'Get a reference to the current database
Set curDatabase = CurrentDb

'Get a reference to a table named Customers
Set tdf = curDatabase.TableDefs("Test")
Set fld = tdf.Fields("OpslagTransAruba9")
fld.Properties.Delete "Format"

Looks like DDL gives your more option, like altering a property

Pampers [afro]
Keeping it simple can be complicated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top