A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Q1: How to create a boolean table field in code?



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old August 10th, 2004, 08:27 PM
Jeff Conrad
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 12:02 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.