If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Q1: How to create a boolean table field in code?
Hi,
Using Access 97 at the moment, but this project will also be compatible for 2000+. I've completed making another Access Add-In and everything works fine, but there are two tiny issues I'd like a little feedback on. Second issue will be in another thread. I'm creating a table in code, but I cannot seem to create a Boolean field using the "Create Table" statement. My workaround is to make all the fields except that one on the first pass. I then use a second function to create a TableDef on the new table and use a CreateField statement to make the Boolean field. This works fine, but what am I missing about using the Create Table statement? As a test try this code from the immediate window: Public Function funcTest() Dim db As DAO.Database Set db = CurrentDb db.Execute "CREATE TABLE tblTest " _ & "(FirstField TEXT, SecondField dbBoolean);" Set db = Nothing End Function I get a syntax error. Instead of dbBoolean I've also tried: Boolean, Yes/No, True/False, -1/0, Up/Down, etc, but nothing seems to work. Is it not possible to make a Boolean field using the Create Table statement? Thanks for any help, -- Jeff Conrad Access Junkie Bend, Oregon *282 Days Left* |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Repost: Calculation problem. Someone help! | Victor | Running & Setting Up Queries | 13 | August 6th, 2004 05:21 PM |
Code to change a table definition | Tim | General Discussion | 3 | June 30th, 2004 02:07 AM |
I can see the data but... | David F-B | General Discussion | 3 | June 24th, 2004 06:15 AM |
Create table with field names based on the value of a field in another table. | [email protected] | Database Design | 5 | May 24th, 2004 02:32 PM |
Make a field lookup dependent on the value in another field of a record? | Susan A | Database Design | 8 | May 22nd, 2004 09:10 PM |