Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > General

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-28-2003, 06:50 AM
Crampton Crampton is offline
Registered User
 
Join Date: Apr 2003
Location: Strood
Posts: 41
Crampton
Part Display

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.
Reply With Quote
Sponsored Links
  #2  
Old 11-28-2003, 06:52 AM
Mile-O's Avatar
Mile-O Mile-O is offline
Administrator
 
Join Date: Dec 2002
Location: Glasgow, UK
Posts: 10,899
Mile-O is on a distinguished road
Original
Reply With Quote
  #3  
Old 11-28-2003, 06:57 AM
Crampton Crampton is offline
Registered User
 
Join Date: Apr 2003
Location: Strood
Posts: 41
Crampton
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?
Reply With Quote
  #4  
Old 11-28-2003, 07:00 AM
Mile-O's Avatar
Mile-O Mile-O is offline
Administrator
 
Join Date: Dec 2002
Location: Glasgow, UK
Posts: 10,899
Mile-O is on a distinguished road
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.
Reply With Quote
  #5  
Old 11-28-2003, 07:24 AM
Crampton Crampton is offline
Registered User
 
Join Date: Apr 2003
Location: Strood
Posts: 41
Crampton
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.
Reply With Quote
  #6  
Old 11-28-2003, 07:25 AM
Mile-O's Avatar
Mile-O Mile-O is offline
Administrator
 
Join Date: Dec 2002
Location: Glasgow, UK
Posts: 10,899
Mile-O is on a distinguished road
=Left([Present Post Code], 5)

Is Present Post Code really the name of your textbox?
Reply With Quote
  #7  
Old 12-03-2003, 01:25 AM
Crampton Crampton is offline
Registered User
 
Join Date: Apr 2003
Location: Strood
Posts: 41
Crampton
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
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes 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

Forum Jump


All times are GMT -8. The time now is 09:45 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World