Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yes/No field in Access

Status
Not open for further replies.

swstran

MIS
Feb 1, 2001
6
US
Is there a way to create Access table with Yes/No, or Boolean, as data type, programmatically, so that when user opens it using Access, the field appears as checkbox? I'm using DAO 3.60.

Thanks.
 
Well, you can almost do it. You'd have to create a Property object with Name = "DisplayControl", Type=3, and Value=106, then append it to the table field's Properties collection. Unfortunately, Access made the Property class non-creatable, so you can't create one yourself. I suppose that was to keep you from doing it wrong and causing Access to crash. I don't now any way around this using DAO.

Maybe there's a way, though. Create your table, then open it in design view and use SendKeys to select the field, press F6 to switch to the properties sheet, Ctrl-Tab to select the Lookup page, then type "Check Box" in the field. It ain't pretty, but it just might work. Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top