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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find first instance of A-Z in alphabetical list 1

Status
Not open for further replies.

HenryAnthony

Technical User
Feb 14, 2001
358
US
Hi,

I have an application that uses a query to create HTML for alphabetically ordered lists of items. I would like to find a way to identify the first instance of the letters A-Z in the list so I can add a named anchor at that point with the end result being able to provide an A-Z navigational menu that takes the user to the items beginning with "T" for example.

I know I could find all the initial letters and add the appropriate code but I want to find the first instance of the initial and skip the rest until the next letter in alpha order is found.

Any ideas on how to approach this are appreciated.

Thank you,

Henry
 
How about creating a table with just the letters A-Z and then using a Union query with your table. Ordering the records should sort the single letter before any longer words.

 
Hey Remou!

Thanks for your response. While I appreciate the merit of your answer, I have, however, answered my own question. It is so simple I don't know how I missed it other than I have not been using Access for much in the last two years.

I am using a report to export the HTML. All I needed to do is pull the first initial out of the field I use to sort in the query and then use a sort and group header in the report. I can then add my HTML in the sort and group header. When I export the report, the named anchor is in the right spot!

This may not be too slick but it works for me and that's the main thing.

Thanks so much!!!

Henry
 
There is certainly quite a difference between a query, which you mention in your first post, and a report, which you mention in your second post.

:)

 
Remou,

Quite a difference indeed. I had not completely thought through my problem and must admit posted my question prematurely.

I think the "better" solution is through using the query as you suggest. However, my solution just needs to generate over 60 pages of HTML with varying prices for nearly 1,400 items. A data driven site would be much better but this is not possible at this time so, using the report header works just fine.

Thanks again!

Henry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top