Solved

Creating a rolodex

Posted on 2004-03-25
6
503 Views
Last Modified: 2008-02-26
I need to create a form that is, in effect, a rolodex file.  I am trying to use tab controls with a tab for each letter of the alphabet ... click on the tab to get members whose last name start with that letter.  I think I can do this with a single form used as a subform for each tab but I can't figure out how to pass a parameter (the first letter to filter on) to the subform.

Any suggestions?  I'm sure it's not hard, but I can't find any examples.

Thanks!
0
Comment
Question by:farscape1
  • 3
  • 2
6 Comments
 
LVL 50

Assisted Solution

by:Steve Bink
Steve Bink earned 75 total points
ID: 10679948
Having a tab for each letter is really going to complicate your work.  Here's a basic version of an app I made once:

Create a new form and bind it to your table.  Put on a combo box populated with all the letters in the alphabet.  Build the remainder of the form as usual.  For the combo box:

Private Sub MyCombo_Change()

Me.Filter = "Left([LastName],1)='" & MyCombo.Text & "'"
Me.FilterOn = True

End Sub

You'll also need an entry/button to clear the filter if you want to be able to 'free-scroll' through your rolodex.  When you open the form, it will show the first record.  If you select a letter from the combo box, the form will filter for only records where the last name starts with the letter you selected, and go to the first record in the new subset.  Each time you change the combo, you change the filter.
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 50 total points
ID: 10679996
I did realize this by showing a one character wide (and 26 character high) listbox based on a query like:

select distinct left(namefield,1) from tblAddresses;

Thus only existing first characters will be visible.

This is placed besides a datasheet subform with all addresses and the OnClick event of the listbox can be used to set a filter like routinet demonstrates.

Nic;o)
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 10680056
Hey nico!  Here you are trying to steal my points...  LOL!  Funny enough that that was a change I made later on to the same app.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 54

Expert Comment

by:nico5038
ID: 10680216
Hi routinet/ Mi Nam,

Great minds think alike :-)

Certainly not intending to steal point as I already have loads of them. Just thought (like you experienced too) that the listbox approach is more userfriendly, especially combined with the distinct selection from the "real data".

I see you have an extensive profile and much experience, glad to have you aboard !

(BTW check my profile when interested in some Dutch scenic pictures, I guess you're not from Europe:-)

Nic;o)
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 10680316
Much experience, but all self-taught, so I lack the 'best practices' knowledge alot of you guys have.  I'm still trying to break my habit of recommending DoCmd.RunSQL instead of CurrentDB.Execute. :)  But hey, I know what I know, and am more than willing to know what you know, too!

Don't mind the points...just pokin fun.  And I already checked ur pics.  Dutch scenery makes for outstanding jigsaw puzzles for some reason..
0
 

Author Comment

by:farscape1
ID: 10682215
Thanks to both of you.  These solutions cover it nicely!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question