> And you need to add the property programatically?
Yes, you do in some cases.
For example, I've implemented an "ad-hoc program" capability in one of
my systems. A user can contact me with their requirements for a custom
update program, or (more generally), a custom report. I develop & test
the relevant SQL statement, then click a button which exports that
statement & related information (eg. a text description of what it
does) to an XML-like format of my own design. Then I email them that
file. Then they go to Tools : Custom Programs, browse to that file, and
click to import it into their "custom programs" list. Then they can run
that custom program, at any time, by selecting it from their list of
installed custom programs.
When a custom program is a report (ie. a SELECT statement) instead of
an update, the custom programs code sends the output to a simple
datasheet. But often, some of the fields in the SELECT statement are
boolean expressions of greater or lesser complexity. Typically, these
will /not/ display as a checkbox in the scenario described herein. They
will display as a numeric column, which of course does not make any
sense to the user. So the code will recognize these columns (in the
datasheet output), and set their DisplayControl property when required.
Then they show as textboxes, which is what is required.
I'm not saying that it is common to need DisplayControl. But ther are
some cases, like that one.
Cheers!
TC
Marshall Barton - 30 Dec 2005 20:42 GMT
>> And you need to add the property programatically?
>
[quoted text clipped - 23 lines]
>I'm not saying that it is common to need DisplayControl. But ther are
>some cases, like that one.
Wow, that sounds pretty elaborate. You might very well need
it in you case.
I have no idea how your "programs" work, but if your query
ends up as a QueryDef, you might want to consider setting
the query field's DisplayControl property instead of the
table field. Although I can easily imagine where that would
be the long way around, I thought it might be worth a
reminder.

Signature
Marsh
MVP [MS Access]
TC - 31 Dec 2005 03:56 GMT
>From memory, fwiw, I actually set the property directly on the
datasheet, using the fact that a datasheet exposes an object model
almost identical to that of a form. I don't set it on any tables. The
situation is where a boolean expression in a query, does not display as
a textbox - so there is no specific table that yo could set it on :-)
Cheers,
TC