Formatting Text

V

Van Reed

I have a report set up with just a list of hometowns and students names (I've
used the trim function to combine first and last name with the comma.:

CITY:
Student,
Student,
Student,

I could really used the report to format the name:

CITY: Student, Student, Student,

I am open to suggestions on how to do this. I think I did it years ago, but
forgot how.

I am using Acess 2003 on a PC.
 
S

Steve

You could use code to iterate through all the cities and at each city build
up a string that looks like Student, Student, Student. Then you would report
city snd string to get CITY: Student, Student, Student, for each city.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
V

Van Reed

Thanks. I am not real good with code. Can you tell me where to look for
more info on how to write a code to do that?

Thanks so much for your help.
 
S

Steve

This is at least intermediate coding! You're not going to find anything that
specifically show you how to do my suggestion. You will have to develop the
logic to do it and then implement the logic with VBA. Find a book or website
that provides a tutorial on VBA. A suggestion is Beginning Access XXX VBA,
Sussman and Smith, Wrox Publishing where XXX is your version of Access.
Start with recordsets, strings, conditional looping. As an alternative, I
could write the code and implement it in your database for a fee of $75.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
V

Van Reed

I'll take the challenge to try it myself first (gotta learn it sooner or
later). If I get stuck, I'll take you up on the offer.

Thanks, Van
 
J

John Spencer

You can use the code at this location to build the string in your query.
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane

Sometimes people recommend using vba in the report to build the string.
This works HOWEVER you can end up with multiple references to the same name
due to the problem that Access will move back and forth between pages as it
determines the page contents (especially with grouping, can shrink, can
grow, and some of the other report properties being active.

So if you had City = Omaha and 3 people in Omaha, VBA code COULD (not will)
end up giving you somethng like the following.

Omaha: John, Sue, John, John, Sue, James

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
J

John Marshall, MVP

Getting bolder again? So how many times do you have to told that these
newsgroups are for FREE help? So, $75 is your reasonable fee or is that just
the hook to charge more?

John... Visio MVP
 
L

Larry Linson

Steve said:
. . . As an alternative, I could write the code
and implement it in your database for a fee of $75.

Steve, Steve, Steve... will you never learn? This is
microsoft.public.access.reports, not
microsoft.public.access.steves.ad.board.

Larry Linson
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top