How to create a yes/no checkbox column in ACCESS 2010

I am adding a yes/no column to an existing table, but the below does not work.  I thought yes/no columns were Bytes, but it is failing.

CurrentDb.Execute "ALTER TABLE tblPerson1 ADD COLUMN AAPerson Byte "
Sandra SmithRetiredAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NorieAnalyst Assistant Commented:
Aren't they boolean?
NorieAnalyst Assistant Commented:
Actually just checked, though a Yes/No is boolean to add such a column with SQL you use BIT.

For example.

ALTER TABLE tblPerson1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sandra SmithRetiredAuthor Commented:
Thank you, thought it was Byte and never considered it was Bit.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

@Norie has it right
yes/no fields are Booleans in Access, bits in SQL Server, but the syntax for adding via SQL is indeed bit

CurrentDb.Execute "ALTER TABLE tblPerson1 ADD COLUMN AAPerson bit"

This gets you a yes/no field in your table.
Bytes are 0 - 255

Byte, Integer and Long IntegerIntegers in Access come in 1, 2 and 4 byte varieties. The single byte number is named Byte (Range 0-255), the two-byte number is named Integer (-32768 to 32767) and then there is the Long Integer (-2 billion to 2 billion).

If I might ask: why would you do something like that through code rather than the GUI?  It's a one-off operation.  Why code it?
Sandra SmithRetiredAuthor Commented:
this is a import process from old database to a new, restructured one and I do not want to have to all this manually each time fresh production data is brought in to test.  The two are structured so differently, I am making an import process to do all the clean up automatically, this is not a one-off operation.  If I could do this another way, I would, but with the time constraints, this is the fastest approach and is working without too many glitches so far.
Good enough.
I hadn't thought of ETL applications of DDL/Alter Table code


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.