View Full Version : Create Field Yes/No


jrmrcol
08-08-2008, 08:12 AM
I want to create a field in an existing table. I want to have a check box display control. with the code below i can create the field as boolean, but i can make the field to display the check box.

I appreaciate all the help, thank you!


Dim db1 As DAO.Database
Dim tdf1 As DAO.TableDef
Dim fld1 As DAO.Field

Set db1 = CurrentDb()
Set tdf1 = db1.TableDefs("Table1")
Set fld1 = tdf1.CreateField("Delete", dbBoolean, acCheckBox) tdf1.Fields.Append fld1

Uncle Gizmo
08-08-2008, 02:38 PM
Tables are only for storing information, not for editing information. Highlight the table in question and then click on the form wizard, select the option to generate a form in datasheet view. You Should now have your records displayed in a similar format to a table/Spread sheet.

jrmrcol
08-11-2008, 06:08 AM
Thanks for your help, but I am not trying to edit the information from the table. I am trying to prepare the table in a simple way, so the user can click on the check box instead of typing a -1. on the FORM. If you actually create a table manually you will see that when creating a field YesNo access creates the check box for you by selecting a Check Box on the display control properties for that field. I am creating a table with code from other tables and what I am trying to do is get to know how to modify the display control through code. Thanks anyway for trying!

neileg
08-11-2008, 06:25 AM
I'll re-ask Tony's question. Why do you care how the field shows in the table? Users should be seeing/entering data in a form.