how to add a space in front of the text field?

B

Blinda

Hi all,

I would like to add a space in front of my text data.

Old data:
E6789
34567
12345

New data will be:
E6789
34567
12345

Please help for that. Thanks,

Blinda
 
F

FedBrad

Hi Blinda,

Noticed you started another string. I just posted a couple input masks to
your previous post. I have tested both and they work fine. I provided two
so that you can decide whether you want to type the decimal point when
entering data or not. And, you will not need to add a space in front of your
existing data.

The only other question I have is whether you were trying to put the input
mask into the field in the table, or on a form?
 
F

fredg

Hi all,

I would like to add a space in front of my text data.

Old data:
E6789
34567
12345

New data will be:
E6789
34567
12345

Please help for that. Thanks,

Blinda
A permanent change?
Back up your database table first.

As long as the field is Text datatype, you can run an Update Query:

Update MyTable Set MyTable.FieldName = chr(32) & [FieldName]

This is not do-able if the field is a Number datatype, as a space is
not a number.
 
B

Blinda

Thanks. This field will be for both the table and the form. The input mask of
CC99\.99! works perfect for all the data with two digits after the decimal
point. but it does not work if I have nothing or only one digit after the
decimal point. Could you please provide sugggestion for it. Thank you very
much. Blinda
 
B

Blinda

Thanks. I have a question:
For Update MyTable Set MyTable.FieldName = chr(32) & [FieldName]
When I put "MyTable.FieldName = chr(32) & [FieldName]" to the update to of
the update query for that FieldName, all of them change to text 0. Could you
help for that?


fredg said:
Hi all,

I would like to add a space in front of my text data.

Old data:
E6789
34567
12345

New data will be:
E6789
34567
12345

Please help for that. Thanks,

Blinda
A permanent change?
Back up your database table first.

As long as the field is Text datatype, you can run an Update Query:

Update MyTable Set MyTable.FieldName = chr(32) & [FieldName]

This is not do-able if the field is a Number datatype, as a space is
not a number.
 
S

strive4peace

Hi Blinda,

if you are using the grid to lay out your query:

field --> [Fieldname]
updateTo --> " " & [Fieldname]

WHERE [Fieldname] is the name of your field

chr(32) is the same thing as " "

May I ask why you are wanting this change?


Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*


Thanks. I have a question:
For Update MyTable Set MyTable.FieldName = chr(32) & [FieldName]
When I put "MyTable.FieldName = chr(32) & [FieldName]" to the update to of
the update query for that FieldName, all of them change to text 0. Could you
help for that?


fredg said:
Hi all,

I would like to add a space in front of my text data.

Old data:
E6789
34567
12345

New data will be:
E6789
34567
12345

Please help for that. Thanks,

Blinda
A permanent change?
Back up your database table first.

As long as the field is Text datatype, you can run an Update Query:

Update MyTable Set MyTable.FieldName = chr(32) & [FieldName]

This is not do-able if the field is a Number datatype, as a space is
not a number.
 
F

fredg

Thanks. I have a question:
For Update MyTable Set MyTable.FieldName = chr(32) & [FieldName]
When I put "MyTable.FieldName = chr(32) & [FieldName]" to the update to of
the update query for that FieldName, all of them change to text 0. Could you
help for that?

fredg said:
Hi all,

I would like to add a space in front of my text data.

Old data:
E6789
34567
12345

New data will be:
E6789
34567
12345

Please help for that. Thanks,

Blinda
A permanent change?
Back up your database table first.

As long as the field is Text datatype, you can run an Update Query:

Update MyTable Set MyTable.FieldName = chr(32) & [FieldName]

This is not do-able if the field is a Number datatype, as a space is
not a number.


I gave you the entire query SQL.
Don't use the QBE grid.
In Query Design View, click on the View + SQL View menu items.
When the SQL window opens type:

Update MyTable Set MyTable.FieldName = chr(32) & [FieldName];

Change MyTable to whatever the actual table name is.
Change FieldName to what ever actual name of the field is.
If the table or field name has a space in it, you must enclose the
name within brackets, i.e. [My Field].

Remember, this will only work if the [FieldName] datatype is Text.
 
B

Blinda

Hi Fred and Crystal,

Thank both of you very much. I figured out that both of you said the same
thing. and your way works prfect for me. Thanks and have a good day.

Blinda


fredg said:
Thanks. I have a question:
For Update MyTable Set MyTable.FieldName = chr(32) & [FieldName]
When I put "MyTable.FieldName = chr(32) & [FieldName]" to the update to of
the update query for that FieldName, all of them change to text 0. Could you
help for that?

fredg said:
On Wed, 21 Mar 2007 15:46:05 -0700, Blinda wrote:

Hi all,

I would like to add a space in front of my text data.

Old data:
E6789
34567
12345

New data will be:
E6789
34567
12345

Please help for that. Thanks,

Blinda
A permanent change?
Back up your database table first.

As long as the field is Text datatype, you can run an Update Query:

Update MyTable Set MyTable.FieldName = chr(32) & [FieldName]

This is not do-able if the field is a Number datatype, as a space is
not a number.


I gave you the entire query SQL.
Don't use the QBE grid.
In Query Design View, click on the View + SQL View menu items.
When the SQL window opens type:

Update MyTable Set MyTable.FieldName = chr(32) & [FieldName];

Change MyTable to whatever the actual table name is.
Change FieldName to what ever actual name of the field is.
If the table or field name has a space in it, you must enclose the
name within brackets, i.e. [My Field].

Remember, this will only work if the [FieldName] datatype is Text.
 
S

strive4peace

you're welcome, Blinda ;)

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*


Hi Fred and Crystal,

Thank both of you very much. I figured out that both of you said the same
thing. and your way works prfect for me. Thanks and have a good day.

Blinda


fredg said:
Thanks. I have a question:
For Update MyTable Set MyTable.FieldName = chr(32) & [FieldName]
When I put "MyTable.FieldName = chr(32) & [FieldName]" to the update to of
the update query for that FieldName, all of them change to text 0. Could you
help for that?

:

On Wed, 21 Mar 2007 15:46:05 -0700, Blinda wrote:

Hi all,

I would like to add a space in front of my text data.

Old data:
E6789
34567
12345

New data will be:
E6789
34567
12345

Please help for that. Thanks,

Blinda
A permanent change?
Back up your database table first.

As long as the field is Text datatype, you can run an Update Query:

Update MyTable Set MyTable.FieldName = chr(32) & [FieldName]

This is not do-able if the field is a Number datatype, as a space is
not a number.

I gave you the entire query SQL.
Don't use the QBE grid.
In Query Design View, click on the View + SQL View menu items.
When the SQL window opens type:

Update MyTable Set MyTable.FieldName = chr(32) & [FieldName];

Change MyTable to whatever the actual table name is.
Change FieldName to what ever actual name of the field is.
If the table or field name has a space in it, you must enclose the
name within brackets, i.e. [My Field].

Remember, this will only work if the [FieldName] datatype is Text.
 
Top