473,804 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7945
<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************ *******@newssvr 14.news.prodigy .com>, Rick
Brandt <ri*********@ho tmail.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*********@ho tmail.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
17750
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 call the PHP program to add the record using POST. When I get the text out, it has lost it's formatting. Formatting in the text is achieved by multiple spaces not tabs, but even multiple spaces are converted to a single space and the carrage...
3
14023
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 dosent meet these requirments an error message will be displayed. I have pasted the code (and highlighted the relevant parts) below in the hope that someone can help me out with this. Ive been trying to suss it out all week & it's driving me nuts!...
5
3019
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 field 1 to field 3, then field 2 text and field 3 move to field 1 and field 2. I add the new order of text into an array so when the onDragEnd event
14
4195
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 equivalent. I know how to compare strings to see whether they meet this criterion--I don't know how to let the combobox know that this is what I want. I am thinking of dealing w/ this in the NotInList_event, but I don't know how to get to the...
2
3168
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 the field and click my mouse on it the cursor is just after the "I" in "HI"... that is, no blanks were added to the field. However, when I create an MDB database programatically in VB.Net using ADOX and create the tables using SQL stmts (ie:...
4
1670
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 Access removed these 4 spaces after losing the focus. Is there a possibility to store only spaces in a text field? Thanks, Jan
9
7716
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 is 8 characters long. This field needs to be exported as pic(15) padded in the front with 0's (zeros). The next field an ID name that is 15 characters that needs to be exported as pic(20) padded with trailing spaces. There are about 5 fields in...
6
18054
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
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10356
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3003
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.