You're not likely to get much help with C# in this forum....VBA? Yes.
Even though the error says Value, I'd suspect the Type parameter. Try
passing a 3 for the Type parameter.

Signature
Paul Overway
Logico Solutions
http://www.logico-solutions.com
Thanks for the tip. Unfortunately, using 3 for the type causes another
runtime exception:
[COMException (0x800a0d5d): Data type conversion error.]
DAO.FieldClass.CreateProperty(Object Name, Object Type, Object Value,
Object DDL) +0
I tried a few other values including
System.Type.GetType("System.Int32")
System.Type.GetTypeCode(System.Type.GetType("System.Int32"))
This is the line of code:
DAO.Property p1 = f.CreateProperty("DisplayControl",
System.Type.GetTypeCode(System.Type.GetType("System.Int32")) , 110,
Type.Missing);
f.Properties.Append( p1 );
Does anyone know what this parameter is expecting to recieve or have
recomendations about where to look to find info on this question?
Thanks!
> You're not likely to get much help with C# in this forum....VBA? Yes.
>
[quoted text clipped - 25 lines]
> >
> > Any help figuring this out would be greatly appreciated.
Mark Burns - 03 May 2005 21:31 GMT
The problem appears to be with the CreateProperty call.
A few key points from The Access 2002 help for this read:
(Comments inline below denoted thus: <*** my stuff ***>)
<quote>
CreateProperty Method
Creates a new user-defined Property object (Microsoft Jet workspaces only).
Syntax
Set property = object.CreateProperty (name, type, value, DDL)
The CreateProperty method syntax has these parts.
Part Description
name Optional. A Variant (String subtype) that uniquely names the new
Property object.
type Optional. A constant that defines the data type of the new Property
object. See the Type property for valid data types.
<*** this will need to be a type as defined in the DAO .DLL, a DataTypeEnum
- not a .net system.(whatever) framework type ***>
value Optional. A Variant containing the initial property value. See the
Value property for details.
DDL Optional. A Variant (Boolean subtype) that indicates whether or not the
Property is a DDL object. The default is False. If DDL is True, users can't
change or delete this Property object unless they have dbSecWriteDef
permission.
<*** Shouldn't you be setting this TRUE for your purposes here? ***>
Remarks
<snip>
Note If you omit the DDL argument, it defaults to False (non-DDL). Because
no corresponding DDL property is exposed, you must delete and re-create a
Property object you want to change from DDL to non-DDL.
</quote>
L Magarian - 03 May 2005 23:38 GMT
Thank you so much! That was exactly the information I needed.
> The problem appears to be with the CreateProperty call.
> A few key points from The Access 2002 help for this read:
[quoted text clipped - 34 lines]
> Property object you want to change from DDL to non-DDL.
> </quote>