DisplayControl property on a field using DAO in C#

G

Guest

Hello,
I am trying to set the DisplayControl property on a field using DAO in
C#. I've found lots of sample code for VB and am trying to adapt it
for use in C#.

This is the code I'm running now:

DAO.Field f = db.TableDefs[TableName].Fields­[ColumnName];

//110 is list box
DAO.Property p1 = f.CreateProperty("DisplayContr­ol", Type.Missing ,
110, Type.Missing);
f.Properties.Append( p1 );


This is the error:

[COMException (0x800a0d3a): Property 'Value' must be set before using
this method.] DAO.Properties.Append(Object Object) +0

The third parameter in the CreateProperty method is the value, so I
don't know why it's not being set.

Any help figuring this out would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top