A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding an Alpha Search Button on a form



 
 
Thread Tools Display Modes
  #1  
Old March 30th, 2005, 04:33 PM
Mojo
external usenet poster
 
Posts: n/a
Default Adding an Alpha Search Button on a form

Does anyone know how to add Alpha search button on a form? For example, I
have a list of 600 names in my table, what I want on the top of my form is
alphabets A-Z and when someone clicks on any letter, all the names starting
with that letter show up. Can anyone help me? Thank you for your time.


  #2  
Old March 30th, 2005, 09:23 PM
Simon Maystre
external usenet poster
 
Posts: n/a
Default

I maanged to do this by using an option group with A-Z and an All button as
well and use the code below to restrict the list to the relevant names:

Dim strSearchChr

Select Case SearchOption

Case 1
strSearchChr = "A"
Case 2
strSearchChr = "B"
Case 3
strSearchChr = "C"
Case 4
strSearchChr = "D"
Case 5
strSearchChr = "E"
Case 6
strSearchChr = "F"
Case 7
strSearchChr = "G"
Case 8
strSearchChr = "H"
Case 9
strSearchChr = "I"
Case 10
strSearchChr = "J"
Case 11
strSearchChr = "K"
Case 12
strSearchChr = "L"
Case 13
strSearchChr = "M"
Case 14
strSearchChr = "N"
Case 15
strSearchChr = "O"
Case 16
strSearchChr = "P"
Case 17
strSearchChr = "Q"
Case 18
strSearchChr = "R"
Case 19
strSearchChr = "S"
Case 20
strSearchChr = "T"
Case 21
strSearchChr = "U"
Case 22
strSearchChr = "V"
Case 23
strSearchChr = "W"
Case 24
strSearchChr = "X"
Case 25
strSearchChr = "Y"
Case 26
strSearchChr = "Z"

End Select

If strSearchChr = 0 Then
Me.FilterOn = False
Else
Me.Filter = "[Name] LIKE '" & strSearchChr & "*'"
Me.FilterOn = True
End If



"Mojo" wrote in message
...
Does anyone know how to add Alpha search button on a form? For example, I
have a list of 600 names in my table, what I want on the top of my form is
alphabets A-Z and when someone clicks on any letter, all the names
starting
with that letter show up. Can anyone help me? Thank you for your time.




  #3  
Old March 30th, 2005, 09:31 PM
Tom Lake
external usenet poster
 
Posts: n/a
Default

"Simon Maystre" wrote in message
...
I maanged to do this by using an option group with A-Z and an All button as
well and use the code below to restrict the list to the relevant names:


How about

strSearchChr = Chr(64 + SearchOption)

Tom Lake


  #4  
Old March 30th, 2005, 09:52 PM
Simon Maystre
external usenet poster
 
Posts: n/a
Default

Hey lot smarter than my solution, will update mine now!

Cheers

Simon

"Tom Lake" wrote in message
...
"Simon Maystre" wrote in message
...
I maanged to do this by using an option group with A-Z and an All button
as well and use the code below to restrict the list to the relevant names:


How about

strSearchChr = Chr(64 + SearchOption)

Tom Lake



  #5  
Old March 30th, 2005, 10:34 PM
John Webb via AccessMonster.com
external usenet poster
 
Posts: n/a
Default

I can see what you want to do, but might I suggest an alternative, to have
a combo box and 'Filer button'. Do the same as is suggested above, but
with the values being in a combo box instead.

Doing it this way will reduce the number of controls from 28 controls (26
option buttons, 1 frame and 1 All option) down to just 2 controls. There
are two real benefits he

1. Less space taken up on your form (nobody likes to see hundreds of
controls on any form)

2. Takes up less memory - each control takes up a small amount of memory,
and therefore affects the speed in which your form loads.

whilst I know this is not the solution you wanted, it is what I would do,
and have in the past.

Cheers

John Webb

--
Message posted via http://www.accessmonster.com
  #6  
Old March 31st, 2005, 07:35 PM
Hermie
external usenet poster
 
Posts: n/a
Default

Mojo
Take a look in the Customer Phone List in the northwind sample database
there is a nice solution too

Herman

"Mojo" wrote in message
...
Does anyone know how to add Alpha search button on a form? For example, I
have a list of 600 names in my table, what I want on the top of my form is
alphabets A-Z and when someone clicks on any letter, all the names

starting
with that letter show up. Can anyone help me? Thank you for your time.




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search by Query and populate my form Big Tom Tuttle Running & Setting Up Queries 1 March 23rd, 2005 09:30 PM
Copy form data to a table Gunner General Discussion 5 January 24th, 2005 08:53 PM
Need to clear controls of Filter form Jan Il Using Forms 2 November 28th, 2004 02:04 PM
Display Parameter from Form on Report sara Setting Up & Running Reports 10 July 19th, 2004 04:54 PM


All times are GMT +1. The time now is 04:49 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.