Solved

Creating a rolodex

Posted on 2004-03-25
6
480 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now