?
Solved

Creating a rolodex

Posted on 2004-03-25
6
Medium Priority
?
586 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 51

Assisted Solution

by:Steve Bink
Steve Bink earned 300 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 200 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 51

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
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
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 51

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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I have had my own IT business for a very long time. I started mostly with hardware and after about a year started to notice a common theme. I had shelves with software boxes -- Peachtree, Quicken, Sage, Ouickbooks -- and yet most of my clients were…
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
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 …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

590 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