PC Review


Reply
Thread Tools Rate Thread

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

 
 
=?Utf-8?B?QmxpbmRh?=
Guest
Posts: n/a
 
      21st Mar 2007
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?RmVkQnJhZA==?=
Guest
Posts: n/a
 
      21st Mar 2007
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?

"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
>
>

 
Reply With Quote
 
fredg
Guest
Posts: n/a
 
      21st Mar 2007
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.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
 
=?Utf-8?B?QmxpbmRh?=
Guest
Posts: n/a
 
      21st Mar 2007
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

"FedBrad" wrote:

> 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?
>
> "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
> >
> >

 
Reply With Quote
 
=?Utf-8?B?QmxpbmRh?=
Guest
Posts: n/a
 
      21st Mar 2007
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" wrote:

> 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.
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail
>

 
Reply With Quote
 
strive4peace
Guest
Posts: n/a
 
      22nd Mar 2007
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
*



Blinda wrote:
> 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" wrote:
>
>> 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.
>> --
>> Fred
>> Please respond only to this newsgroup.
>> I do not reply to personal e-mail
>>

 
Reply With Quote
 
fredg
Guest
Posts: n/a
 
      22nd Mar 2007
On Wed, 21 Mar 2007 16:50:00 -0700, Blinda wrote:

> 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" wrote:
>
>> 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.
>> --
>> Fred
>> Please respond only to this newsgroup.
>> I do not reply to personal e-mail
>>



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.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 
Reply With Quote
 
=?Utf-8?B?QmxpbmRh?=
Guest
Posts: n/a
 
      22nd Mar 2007
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" wrote:

> On Wed, 21 Mar 2007 16:50:00 -0700, Blinda wrote:
>
> > 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" wrote:
> >
> >> 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.
> >> --
> >> Fred
> >> Please respond only to this newsgroup.
> >> I do not reply to personal e-mail
> >>

>
>
> 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.
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail
>

 
Reply With Quote
 
strive4peace
Guest
Posts: n/a
 
      23rd Mar 2007
you're welcome, Blinda

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



Blinda wrote:
> 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" wrote:
>
>> On Wed, 21 Mar 2007 16:50:00 -0700, Blinda wrote:
>>
>>> 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" wrote:
>>>
>>>> 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.
>>>> --
>>>> Fred
>>>> Please respond only to this newsgroup.
>>>> I do not reply to personal e-mail
>>>>

>>
>> 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.
>> --
>> Fred
>> Please respond only to this newsgroup.
>> I do not reply to personal e-mail
>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a leading space to an existing text field? richprince Microsoft Excel New Users 1 27th Apr 2010 11:07 PM
How to decrease the padding space between outer box and text inside the Text field? Shawn Fielding Microsoft Powerpoint 1 21st Jul 2009 01:51 PM
Remove blank space in front of text in multiple cells at once SMS Microsoft Excel Misc 2 13th Jan 2009 08:04 AM
Conversion of a number to an exported text field with front loaded =?Utf-8?B?TmV3SGVhcnRNYW4=?= Microsoft Access External Data 1 6th Oct 2006 09:56 PM
input text at front of field that contains data =?Utf-8?B?U3RldmUgTQ==?= Microsoft Excel Misc 3 16th May 2005 12:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:42 AM.