Part Display

Crampton

Registered User.
Local time
Today, 22:38
Joined
Apr 8, 2003
Messages
41
Sorry good people, I got a reply to the following topic from FoFa a while ago and I thought I sorted out the problem but Im not sure where to put the text that FoFa suggested. Sorry for being thick but im a newbie.

My problem:-

I have to produce a report showing only the initials of a person's surname, and just the first 4 digits of a person's postcode.

The 1000s of records which are currently in the database at the moment are as follows:- Colin Smith, James Brown etc etc

I would like this to display C S, and J B on the report.

The same goes for postcoding, ie:- ME2 3ER

I would like this to display ME2 3 on the report.

FoFa solution was:-

If the postal code is always xxx xxx you can use LEFT(PostalCode,5). Names are an issue if they are contained in one field. You can parse them looking for space, but you usually run into those that are suppose to have a space and then they get screwed up. If the names are in different fields, you can use LEFT(FirstName,1) & " " & LEFT(LastName,1) (using your example).


Im just not sure where this goes.

Can anyone help me with this please.

Thanks all.
 
Mile-o-phile

I tried to put the text that FoFa suggested in the expression box of the query.

Is this not the right place?
 
It's not that. The thread you initially had is so recent and the question is not new but an extension of the original that I don't see what was wrong with continuing on that thread.

Anyway, it's done now.

So, hide the textbox that's bound to the post code field on your report.

Put a new control on the form and put Fofa's expression in its ControlSource referring to the hidden textbox.
 
Sorry about that Mile-o-phile, noted for next time.

Anyhow I have done the following:-

1) Set my text box to not visible.

2) Created a new text box and put this is the control source:-

LEFT(Present Post Code,5)

All it does is ask me for a parameter value for the above?!!!

Help, i know its really simple, but prehaps its just the Friday thing!

Many thanks for your time.
 
=Left([Present Post Code], 5)

Is Present Post Code really the name of your textbox? :eek:
 
Sorry for not thanking you earlier Mile-O-Phile but that last code worked perfectly.

Many thanks for your time.

PS- Present Post Code is my field name, is there a better convention for field names that I am not using?

Thanks again:)
 

Users who are viewing this thread

Back
Top Bottom