Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / April 2006

Tip: Looking for answers? Try searching our database.

Is it possible to set a text field to spaces?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
usenet@isbd.co.uk - 04 Apr 2006 23:09 GMT
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'?

Signature

Chris Green

Rick Brandt - 05 Apr 2006 00:00 GMT
>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.

Signature

I don't check the Email account attached
to this message.     Send instead to...
RBrandt    at       Hunter      dot      com

Bernard Peek - 05 Apr 2006 00:57 GMT
>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.

Signature

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

usenet@isbd.co.uk - 05 Apr 2006 14:03 GMT
> >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
[quoted text clipped - 9 lines]
> 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?

Signature

Chris Green

Ted - 05 Apr 2006 01:03 GMT
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

> 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'?
Br@dley - 05 Apr 2006 11:26 GMT
> 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
[quoted text clipped - 8 lines]
> strSpace = Chr(32)
> strSpaces5 = Chr(32) & Chr(32) & Chr(32) & Chr(32) & Chr(32)

Icky.

Space(5)

Simple eh? :)

<>
Signature

regards,

Br@dley

usenet@isbd.co.uk - 05 Apr 2006 14:03 GMT
> Ted
>
[quoted text clipped - 17 lines]
> 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.

Signature

Chris Green

Br@dley - 06 Apr 2006 00:43 GMT
>> Ted
>>
[quoted text clipped - 25 lines]
> 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)
Signature

regards,

Br@dley

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.