By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,978 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,978 IT Pros & Developers. It's quick & easy.

Is it possible to set a text field to spaces?

P: n/a
I would like, if it's possible, to set the value of a field in a table
to a number of spaces. One space would be fine, I just want to be
able to set the field to a default value that's not NULL but also
doesn't show anything when the field is displayed.

Is this possible or would it be a 'bad thing'?

--
Chris Green

Apr 4 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
<us****@isbd.co.uk> wrote in message news:4432d61e.0@entanet...
I would like, if it's possible, to set the value of a field in a table
to a number of spaces. One space would be fine, I just want to be
able to set the field to a default value that's not NULL but also
doesn't show anything when the field is displayed.

Is this possible or would it be a 'bad thing'?


In design view of the table you can turn on the property "Allow Zero Length
String" for that field and then set the default value to "". And yes I would
consider that a bad thing to do.

I don't like the idea of a field that can have two possible values that both
"look" the same.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Apr 4 '06 #2

P: n/a
In message <gU*******************@newssvr14.news.prodigy.com> , Rick
Brandt <ri*********@hotmail.com> writes

In design view of the table you can turn on the property "Allow Zero Length
String" for that field and then set the default value to "". And yes I would
consider that a bad thing to do.

I don't like the idea of a field that can have two possible values that both
"look" the same.


It's better than having a system that lets users create different files
called and . That did cause a fair amount of confusion when I used
those in a database.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Apr 5 '06 #3

P: n/a
Ted
I deal with accounting software that requires a value in all fields.
When I write data from my Access application into their data tables, I
have to insert spaces into fields where I don't have a value ot insert,
so I create spaces in fields by assigning the value of Chr(32) which is
the value of the "space".
If I need more than one field with those spaces, I use a variables such
as:

Dim strSpace As String
Dim strSpaces5 As String
strSpace = Chr(32)
strSpaces5 = Chr(32) & Chr(32) & Chr(32) & Chr(32) & Chr(32)

Ted

us****@isbd.co.uk wrote:
I would like, if it's possible, to set the value of a field in a table
to a number of spaces. One space would be fine, I just want to be
able to set the field to a default value that's not NULL but also
doesn't show anything when the field is displayed.

Is this possible or would it be a 'bad thing'?

--
Chris Green


Apr 5 '06 #4

P: n/a
Br
Ted wrote:
I deal with accounting software that requires a value in all fields.
When I write data from my Access application into their data tables, I
have to insert spaces into fields where I don't have a value ot
insert, so I create spaces in fields by assigning the value of
Chr(32) which is the value of the "space".
If I need more than one field with those spaces, I use a variables
such as:

Dim strSpace As String
Dim strSpaces5 As String
strSpace = Chr(32)
strSpaces5 = Chr(32) & Chr(32) & Chr(32) & Chr(32) & Chr(32)

Icky.

Space(5)

Simple eh? :)

<>
--
regards,

Br@dley
Apr 5 '06 #5

P: n/a
Rick Brandt <ri*********@hotmail.com> wrote:
<us****@isbd.co.uk> wrote in message news:4432d61e.0@entanet...
I would like, if it's possible, to set the value of a field in a table
to a number of spaces. One space would be fine, I just want to be
able to set the field to a default value that's not NULL but also
doesn't show anything when the field is displayed.

Is this possible or would it be a 'bad thing'?


In design view of the table you can turn on the property "Allow Zero Length
String" for that field and then set the default value to "". And yes I would
consider that a bad thing to do.

I don't like the idea of a field that can have two possible values that both
"look" the same.

No, I can't set it to "" as that is NULL and I don't want the value to
be NULL.

In Oracle SQL (with which I am fairly familiar) it's dead easy:-

SQL> desc SYS_PARAM
Name Null? Type
----------------------------------------- -------- ----------------------------
NAME NOT NULL VARCHAR2(34)
VALUE NOT NULL VARCHAR2(30)
DESCRIPTION VARCHAR2(120)

SQL> insert into SYS_PARAM values(' ', ' ', 'empty space');

1 row created.

A space is just as valid data as any other ASCII character so why
shouldn't I be able to put one in a column value?

--
Chris Green

Apr 5 '06 #6

P: n/a
Ted <be*****@gmail.com> wrote:

Ted

us****@isbd.co.uk wrote:
I would like, if it's possible, to set the value of a field in a table
to a number of spaces. One space would be fine, I just want to be
able to set the field to a default value that's not NULL but also
doesn't show anything when the field is displayed.

Is this possible or would it be a 'bad thing'?

--
Chris Green


I deal with accounting software that requires a value in all fields.
When I write data from my Access application into their data tables, I
have to insert spaces into fields where I don't have a value ot insert,
so I create spaces in fields by assigning the value of Chr(32) which is
the value of the "space".
If I need more than one field with those spaces, I use a variables such
as:

Dim strSpace As String
Dim strSpaces5 As String
strSpace = Chr(32)
strSpaces5 = Chr(32) & Chr(32) & Chr(32) & Chr(32) & Chr(32)


But can I get a space into a table without writing VB to do it?

For that matter how do I do it in VB, all the above does is tell me
how to create a variable containing a space which I knew already.

--
Chris Green

Apr 5 '06 #7

P: n/a
Br
us****@isbd.co.uk wrote:
Ted <be*****@gmail.com> wrote:

Ted

us****@isbd.co.uk wrote:
I would like, if it's possible, to set the value of a field in a
table to a number of spaces. One space would be fine, I just want
to be able to set the field to a default value that's not NULL but
also doesn't show anything when the field is displayed.

Is this possible or would it be a 'bad thing'?

--
Chris Green


I deal with accounting software that requires a value in all fields.
When I write data from my Access application into their data tables,
I have to insert spaces into fields where I don't have a value ot
insert, so I create spaces in fields by assigning the value of
Chr(32) which is the value of the "space".
If I need more than one field with those spaces, I use a variables
such as:

Dim strSpace As String
Dim strSpaces5 As String
strSpace = Chr(32)
strSpaces5 = Chr(32) & Chr(32) & Chr(32) & Chr(32) & Chr(32)


But can I get a space into a table without writing VB to do it?

For that matter how do I do it in VB, all the above does is tell me
how to create a variable containing a space which I knew already.


Create an update query, add you table, and add a column:

Field: MyField
UpdateTo: Space(5)
--
regards,

Br@dley
Apr 5 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.