By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,098 Members | 1,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,098 IT Pros & Developers. It's quick & easy.

Indexing a phone book

P: n/a
I'm creating a fairly phone book for an organization (maybe 400 pages).
Members are listed out by chapter with their phone number and all that.
There is also to be an index by last name. In creating the index by last
name, how do I find out what page a person's name is on in the chapter
directory?
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Sat, 5 Feb 2005 21:27:24 -0800, "Mike Turco"
<mi*******@yahoo-no-spam-4-me.com> wrote:
I'm creating a fairly phone book for an organization (maybe 400 pages).
Members are listed out by chapter with their phone number and all that.
There is also to be an index by last name. In creating the index by last
name, how do I find out what page a person's name is on in the chapter
directory?


Easy. Put some VBA into the Report (probably on the Format event, but
I can imagine it can put in a number of different places) that writes
what you want to "recall" to a temporary table.

Then use that table as the basis for your index report.

DJ
Nov 13 '05 #2

P: n/a
Mike Turco wrote:
I'm creating a fairly phone book for an organization (maybe 400 pages). Members are listed out by chapter with their phone number and all that. There is also to be an index by last name. In creating the index by last name, how do I find out what page a person's name is on in the chapter directory?


This is probably useless but if the records are the same vertical size
then you could add a rownumber to a query that's the same as the one
used to build the chapter. I came up with a way to add the rownumbers
then googled and saw that many others used the same technique in the
past.

Technique illustrated:
tblInvoices
InvoiceID InvoiceDate SupplierID Data
1 1/1/05 18 Some data
3 1/2/05 23 More data
5 1/3/05 9 Even more data

where InvoiceID is an autonumberfield.

qryInvoices
SELECT InvoiceID, InvoiceDate, SupplierID, Data FROM tblInvoices ORDER
BY InvoiceId;

qryInvoiceWithRecordNumber
SELECT (SELECT Count(A.InvoiceId) + 1 FROM qryInvoices As A WHERE
A.InvoiceID < qryInvoices.InvoiceID) AS RecordNumber,
qryInvoices.InvoiceID, qryInvoices.InvoiceDate, qryInvoices.SupplierID,
qryInvoices.Data FROM qryInvoices;

gives:

RecordNumber InvoiceID Date SupplierID Data
1 1 1/1/05 18 Some data
2 3 1/2/05 23 More data
3 5 1/3/05 9 Even more data
Then you can use (RecordNumber - 1) \ RecordsPerPage + 1 to get what
page they're on.

James A. Fortune

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.