Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field values ending with a SPACE

Status
Not open for further replies.

SaturnSeven

Programmer
Aug 4, 2005
40
GB
I need to enter values (part post codes) into a text field in a table that may end with a space. It so I can query a range of part post code against a customer address.
EG "RG1 " so I can select all customers in RG1 area without selecting RG10, RG11, RG12 etc
However After entering "RG1 " into the table, Access deletes the ending space and converts it to "RG1"
How can I stop this from happening
Any help will be greatlt appreciated
 
You cannot.

It is a documented feature of the Text(x) data type that any trailing space characters are removed from the data when stored.


Could you consider saving a '#' character or something similar and then when you recover the data from the field you do a Replace(datastring,'#',' ')



'ope-that-'elps.


G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Sorry but I don't understand why you need the trailing space in the table as you may concatenate one in the SQL code: [part postcode] & ' '

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I can not simply add a space to the field because some value need to be without the space
Eg "RH" will pick up all Postcodes like RH*, and "RG1 " will pick up all postcodes like "RG1 ". If you use "RG1" you pick up RG10, RG11 etc.

Anyway I have found a way around the problem by creating the correct values in Excel and then importing in a new table. For some reason it retains the space.

But thanks for looking
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top