473,320 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Is it possible to set a text field to spaces?

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
7 7865
<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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: James Turner | last post by:
I am trying to store formatted text (windows format) into a MySQL database and then retrieve it. The field in the database is a varchar. I cut and paste the test into a form field formatted, then...
3
by: Mark | last post by:
Hi, Im trying to validate a form, all the validating works apart from one field. This particular field must consist of the first 2 characters as letters, & the following 5 as numbers. And if it...
5
by: simon_s_li | last post by:
Hi, I have 5 fields in line where I need to drag and drop the text from one field to another field and then all the fields need to re-order themselves. So for instance if I drag the text in...
14
by: Thelma Lubkin | last post by:
I am trying to limit the user's options to the choices offered by the combobox text, but I don't want this to extend to how he spaces out the text, e.g. 'abcdefg' and 'ab cd efg' should be...
2
by: JohnR | last post by:
When creating an msAccess db within the Access UI itself the fields that are text are NOT padded with blanks. For example, if I have a 10 char field and put in "HI" and then when I come back to...
4
jdesaer
by: jdesaer | last post by:
I'm testing an application and use Access to store the test data in. But there is a field in my application that has 4 blancs. So I want to store 4 spaces in the corresponding field in Access, but...
9
by: NEWSGROUPS | last post by:
I have data in a table in an Access 2000 database that needs to be exported to a formatted text file. For instance, the first field is an account number that is formatted in the table as text and...
6
by: MikeC | last post by:
Folks, Can the width specifier be used in a printf() text string? If I execute... printf("%4s", ".........."); it prints ten dots. If I execute
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.