Connecting Tech Pros Worldwide Help | Site Map

CreateProperty

  #1  
Old August 23rd, 2007, 08:05 AM
chris@kissolutions.net
Guest
 
Posts: n/a
Hi

I have a simple split db, that I want to create a backend table with
Fields, PK, Indexes and Formats.

The problem I am getting is the Error No 3219 from this line of code:-
fldInd.Properties.Append prpFld

"You tried to append a property to a Properties collection of an
object that does not support user-defined properties. "

Set tdfEmpHrs = dbLink.CreateTableDef("tblEmpHrs")
'Create Fields
With tdfEmpHrs

'St Date - Create
Set fldInd = .CreateField("EmpHrsSt", dbDate)
.Fields.Append fldInd
'Properties
Set prpFld = fldInd.CreateProperty("Format")
prpFld.Type = dbText 'or
dbDate
prpFld.Value = "Short Date"
fldInd.Properties.Append prpFld
fldInd.Properties.Refresh

Ive tried this line of code too to Format the Date Field, with the
same error:-

Set prpFld = fldInd.CreateProperty("Format", dbDate or
dbText, "Short Date")
fldInd.Properties.Append prpFld

Im not sure why you have to use dbText Data Type in a dbDate Field,
but I saw it on one of Allen Browne's reply to a posting!

Any help would be appreciated!

Thanks for your time and efforts!

Chris - Sydney Australia

  #2  
Old August 23rd, 2007, 02:45 PM
OldPro
Guest
 
Posts: n/a

re: CreateProperty


On Aug 23, 2:03 am, ch...@kissolutions.net wrote:
Quote:
Hi
>
I have a simple split db, that I want to create a backend table with
Fields, PK, Indexes and Formats.
>
The problem I am getting is the Error No 3219 from this line of code:-
fldInd.Properties.Append prpFld
>
"You tried to append a property to a Properties collection of an
object that does not support user-defined properties. "
>
Set tdfEmpHrs = dbLink.CreateTableDef("tblEmpHrs")
'Create Fields
With tdfEmpHrs
>
'St Date - Create
Set fldInd = .CreateField("EmpHrsSt", dbDate)
.Fields.Append fldInd
'Properties
Set prpFld = fldInd.CreateProperty("Format")
prpFld.Type = dbText 'or
dbDate
prpFld.Value = "Short Date"
fldInd.Properties.Append prpFld
fldInd.Properties.Refresh
>
Ive tried this line of code too to Format the Date Field, with the
same error:-
>
Set prpFld = fldInd.CreateProperty("Format", dbDate or
dbText, "Short Date")
fldInd.Properties.Append prpFld
>
Im not sure why you have to use dbText Data Type in a dbDate Field,
but I saw it on one of Allen Browne's reply to a posting!
>
Any help would be appreciated!
>
Thanks for your time and efforts!
>
Chris - Sydney Australia
It isn't possible to add a field to a linked table through code.

  #3  
Old August 24th, 2007, 12:35 AM
chris@kissolutions.net
Guest
 
Posts: n/a

re: CreateProperty


On Aug 23, 11:38 pm, OldPro <rrossk...@sbcglobal.netwrote:
Quote:
On Aug 23, 2:03 am, ch...@kissolutions.net wrote:
>
>
>
>
>
Quote:
Hi
>
Quote:
I have a simple split db, that I want to create a backend table with
Fields, PK, Indexes and Formats.
>
Quote:
The problem I am getting is the Error No 3219 from this line of code:-
fldInd.Properties.Append prpFld
>
Quote:
"You tried to append a property to a Properties collection of an
object that does not support user-defined properties. "
>
Quote:
Set tdfEmpHrs = dbLink.CreateTableDef("tblEmpHrs")
'Create Fields
With tdfEmpHrs
>
Quote:
'St Date - Create
Set fldInd = .CreateField("EmpHrsSt", dbDate)
.Fields.Append fldInd
'Properties
Set prpFld = fldInd.CreateProperty("Format")
prpFld.Type = dbText 'or
dbDate
prpFld.Value = "Short Date"
fldInd.Properties.Append prpFld
fldInd.Properties.Refresh
>
Quote:
Ive tried this line of code too to Format the Date Field, with the
same error:-
>
Quote:
Set prpFld = fldInd.CreateProperty("Format", dbDate or
dbText, "Short Date")
fldInd.Properties.Append prpFld
>
Quote:
Im not sure why you have to use dbText Data Type in a dbDate Field,
but I saw it on one of Allen Browne's reply to a posting!
>
Quote:
Any help would be appreciated!
>
Quote:
Thanks for your time and efforts!
>
Quote:
Chris - Sydney Australia
>
It isn't possible to add a field to a linked table through code.- Hide quoted text -
>
- Show quoted text -
Hi OldPro

Im sad tell you, that you can add Tables, Fields, DataTypes, Indexes,
DefaultValues to Linked Tables. The problem I am having is the
"Format" Property for DateFields = "Short Date", and the "Format"
Property for a BooleanField = "Yes/No".

Thanks for your response.

Chris

  #4  
Old August 24th, 2007, 05:25 PM
JHB
Guest
 
Posts: n/a

re: CreateProperty


Quote:
Quote:
Set db =
OpenDatabase("C:\DATA\Access\Access2002\ADataRepos itory.MDB")
Quote:
Quote:
Set tdf = db.TableDefs("Employees")
tdf.Fields.Append tdf.CreateField("DateAdded", dbDate)
Set fld = tdf.Fields("DateAdded")
fld.Properties.Append fld.CreateProperty("Format", dbText, "Short
Date")
Quote:
Quote:
Set fld = Nothing
Set tdf = Nothing
Set db = Nothing

I hope this is of help to you.

Larry Linson
Microsoft Access MVP
>
I have no problem using Larry's code.
The field is by me in "Short Date" format.

Regards
Jørn




Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening form after error smiler2505 answers 42 May 4th, 2007 12:59 PM
Creating A Table With More Properties Than Fieldname, Length, Type smiler2505 answers 12 April 26th, 2007 09:01 PM
CreateProperty Jeremy Wallace answers 4 November 12th, 2005 04:22 PM
By Pass Keys Adonis Walmsley-McCarthy answers 3 November 12th, 2005 03:47 PM