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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create table with SQL statement 1

Status
Not open for further replies.

BuzzerTom

Technical User
Aug 20, 2003
35
BE
Hi all,

Below is my SQL statement that creates a table. It works fine, but my column called Room1 is formated as text box (wich is the standerd in Microsoft Access) but I want it as check box. How can I change this SQL statement so that when I open the table in Access I see the values from the Room1 column as check boxes and no longer as text boxes? I can do it manually, but I wondered if I could change the SQL statement below to do it automaticly.

CREATE TABLE tbl_test(Autonummer AUTOINCREMENT CONSTRAINT Autonummer PRIMARY KEY, Datum DATE, Room1 LOGICAL)

Thanks in advance,
Buzzer
 
Thanks for the reply,

I tried the four different synonyms and each of them makes a correct column with bolean values, but they are all displayed as -1 or 0. What I want is when you open access, you see them as check boxes. If I open the table in Access and I go to the column with the bolean values then to 'Look Up' and then change the value there from 'text box' to 'check box' it looks like I want. But I can't do it manually for all the columns, so can I alter the SQL statement so that it's properly formatted right away ?

Buzzer
 
You may need to mess with the field's properties after you have created the table.
Code:
CurrentDB.TableDefs("tbl_test").Fields("Room1").Properties("DisplayControl") = 106
[tt]
106 ---> Check Box
109 ---> Text Box
111 ---> Combo Box
[/tt]
 
Thanks Golom for the reply,

However I execute the sql statement from an asp page. So I have to figure out how I can execude your code from asp. Do you have any ideas ?

Greetz,
Buzzer
 
None ... I can't even spell asp.

But if you repost in forum333 (Active Server Pages ASP) the gurus over there will probably know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top