Set Display Control in Property from code

G

Guest

Hi!
I am trying to create / change the DisplayControl property of a yes/no field
in Access 2003 to display a CheckBox (property.value= 106) from vba code.
I'm sure I've done this before, but I forgot how I did it.
I know that the DisplayControl property is a User Defined property and that
it doesn't exist until it is created by the User in Table Design view or
through vba code using DAO. I seem to be able to create the property and even
change it so that the property value prints out in the debug window as 106
but when I open the table in edit mode, the values displayed are still -1 and
0 (not very nice for my users)
How do I get a yes/no field created from code to display as a checkbox
without manually opening the table in design view and changing the "Display
Control" property on the Lookup tab?

Thanks in advance...

I have tried several methodes including creating the property like this
 
J

Jeff Boyce

Are you saying you want the TABLE to display a checkbox? If so, bear in
mind that tables store data in Access and forms, reports (and queries)
display data.

If you were working in Excel, I could see working directly on the
spreadsheet, but Access is a relational database, and the tables are
essentially "buckets o' data", and not intended for use by users.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Hi there, Jeff, thank you for your response. I've been programming
professionally in Access since 1995. And Yes, I want my tables to display
YesNo data in CheckBoxes when I create a YesNo (boolean) data type. Bear in
mind that the CheckBox is the defauit display format for YESNO fields in
Access tables (when you create them manually, that is).
--
Everything in EXCESS!!! If you want to taste the flavor of LIFE, Take BIG
Bytes. Moderation is for monks…


Jeff Boyce said:
Are you saying you want the TABLE to display a checkbox? If so, bear in
mind that tables store data in Access and forms, reports (and queries)
display data.

If you were working in Excel, I could see working directly on the
spreadsheet, but Access is a relational database, and the tables are
essentially "buckets o' data", and not intended for use by users.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jeff Boyce

Best of luck!

I've not had experience modifying the display characteristics of tables via
code. Probably because I rarely display tables ... forms and their events
give so much more control.

Jeff Boyce
Microsoft Office/Access MVP

Rev said:
Hi there, Jeff, thank you for your response. I've been programming
professionally in Access since 1995. And Yes, I want my tables to display
YesNo data in CheckBoxes when I create a YesNo (boolean) data type. Bear
in
mind that the CheckBox is the defauit display format for YESNO fields in
Access tables (when you create them manually, that is).
 

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