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  

Filtering information in a list box



 
 
Thread Tools Display Modes
  #1  
Old June 3rd, 2004, 02:21 PM
Deb Smith
external usenet poster
 
Posts: n/a
Default Filtering information in a list box

I have a form with a list box that contains three items
(LName,FName,PersonID). Using recordset and Bookmark when you click on an
item in the list box the form's information is automatically populated.

There are a large number of records in the list box so scrolling to find the
appropriate record is cumbersome. I want to filter the records in the list
box alphabetically by lname(column1) so that only a limited number of
records display in the list box at a time. For example only records with
people with last names starting with "C".

I just can't seem to get this to work.

Help Please!!


  #2  
Old June 3rd, 2004, 03:40 PM
Wayne Morgan
external usenet poster
 
Posts: n/a
Default Filtering information in a list box

Base the Row Source of the listbox on a query. Set the sorting in the query
as desired. In the criteria of the query place

Like Forms!frmMyForm!txtMyTextbox & "*"

under the last name field. Add a textbox to the form that the user can type
in the first letter (or more if desired) of the last name. In the
AfterUpdate event of the textbox do a requery on the listbox. The textbox
will Update when the user presses enter or moves to another control.

Me.lstMyListbox.Requery

--
Wayne Morgan
Microsoft Access MVP


"Deb Smith" wrote in message
...
I have a form with a list box that contains three items
(LName,FName,PersonID). Using recordset and Bookmark when you click on an
item in the list box the form's information is automatically populated.

There are a large number of records in the list box so scrolling to find

the
appropriate record is cumbersome. I want to filter the records in the list
box alphabetically by lname(column1) so that only a limited number of
records display in the list box at a time. For example only records with
people with last names starting with "C".

I just can't seem to get this to work.

Help Please!!




  #3  
Old June 3rd, 2004, 08:31 PM
Deb Smith
external usenet poster
 
Posts: n/a
Default Filtering information in a list box

Thanks for the solution! While it works there are some limitations in terms
of my application and the interface with the end-users..

I was wondering if there was another way to accomplish filtering the records
in the list box alphabetically by lname(column1) so that only a limited
number of records display in the list box at a time. Can an option group or
some other button driven method work. I have tried, but have been
unsuccessful.

Also is there a way to make it so that the items in the list box scroll and
correspond to the actual records vs remaining on the original person chosen.

Thanks again for the assistance.
"Wayne Morgan" wrote in message
...
Base the Row Source of the listbox on a query. Set the sorting in the

query
as desired. In the criteria of the query place

Like Forms!frmMyForm!txtMyTextbox & "*"

under the last name field. Add a textbox to the form that the user can

type
in the first letter (or more if desired) of the last name. In the
AfterUpdate event of the textbox do a requery on the listbox. The textbox
will Update when the user presses enter or moves to another control.

Me.lstMyListbox.Requery

--
Wayne Morgan
Microsoft Access MVP


"Deb Smith" wrote in message
...
I have a form with a list box that contains three items
(LName,FName,PersonID). Using recordset and Bookmark when you click on

an
item in the list box the form's information is automatically populated.

There are a large number of records in the list box so scrolling to find

the
appropriate record is cumbersome. I want to filter the records in the

list
box alphabetically by lname(column1) so that only a limited number of
records display in the list box at a time. For example only records with
people with last names starting with "C".

I just can't seem to get this to work.

Help Please!!






  #4  
Old June 4th, 2004, 08:30 PM
Wayne Morgan
external usenet poster
 
Posts: n/a
Default Filtering information in a list box

Yes, you can use other contols. To use an Option Group, I would probably set
up a hidden, unbound textbox on the form to hold the data for the query's
criteria. The query would refer to this hidden textbox. In the AfterUpdate
event of the option group, update the textbox to the desired value. An
option group returns a number, you'll need to convert this into the
appropriate letter(s).

As far as scolling the listbox goes, you could use the Current event of the
form to get the current user id then set the value of the listbox to this
id. This will move the highlighted selection and, hopefully, will scroll the
listbox when the selection drops out of the visible range.

--
Wayne Morgan
MS Access MVP


"Deb Smith" wrote in message
...
Thanks for the solution! While it works there are some limitations in

terms
of my application and the interface with the end-users..

I was wondering if there was another way to accomplish filtering the

records
in the list box alphabetically by lname(column1) so that only a limited
number of records display in the list box at a time. Can an option group

or
some other button driven method work. I have tried, but have been
unsuccessful.

Also is there a way to make it so that the items in the list box scroll

and
correspond to the actual records vs remaining on the original person

chosen.

Thanks again for the assistance.
"Wayne Morgan" wrote in

message
...
Base the Row Source of the listbox on a query. Set the sorting in the

query
as desired. In the criteria of the query place

Like Forms!frmMyForm!txtMyTextbox & "*"

under the last name field. Add a textbox to the form that the user can

type
in the first letter (or more if desired) of the last name. In the
AfterUpdate event of the textbox do a requery on the listbox. The

textbox
will Update when the user presses enter or moves to another control.

Me.lstMyListbox.Requery

--
Wayne Morgan
Microsoft Access MVP


"Deb Smith" wrote in message
...
I have a form with a list box that contains three items
(LName,FName,PersonID). Using recordset and Bookmark when you click on

an
item in the list box the form's information is automatically

populated.

There are a large number of records in the list box so scrolling to

find
the
appropriate record is cumbersome. I want to filter the records in the

list
box alphabetically by lname(column1) so that only a limited number of
records display in the list box at a time. For example only records

with
people with last names starting with "C".

I just can't seem to get this to work.

Help Please!!








  #5  
Old June 5th, 2004, 03:37 AM
Russ
external usenet poster
 
Posts: n/a
Default Filtering information in a list box

A friend of mine has done this nicely. He clicks on a list of the
alphabet and only the records beginning with that letter will appear.
I've asked him to send me a copy of his db and when I get it I'll
repost on how it's done.

Russ


On Thu, 3 Jun 2004 09:21:22 -0400, "Deb Smith"
wrote:

I have a form with a list box that contains three items
(LName,FName,PersonID). Using recordset and Bookmark when you click on an
item in the list box the form's information is automatically populated.

There are a large number of records in the list box so scrolling to find the
appropriate record is cumbersome. I want to filter the records in the list
box alphabetically by lname(column1) so that only a limited number of
records display in the list box at a time. For example only records with
people with last names starting with "C".

I just can't seem to get this to work.

Help Please!!


  #6  
Old June 5th, 2004, 04:04 AM
Russ
external usenet poster
 
Posts: n/a
Default Filtering information in a list box

My friend emails me that he borrowed that technique from the Northwind
db. I don't have it installed on this limited space laptop, so I
haven't looked, but you might give it a peek.

Russ

On Thu, 3 Jun 2004 09:21:22 -0400, "Deb Smith"
wrote:

I have a form with a list box that contains three items
(LName,FName,PersonID). Using recordset and Bookmark when you click on an
item in the list box the form's information is automatically populated.

There are a large number of records in the list box so scrolling to find the
appropriate record is cumbersome. I want to filter the records in the list
box alphabetically by lname(column1) so that only a limited number of
records display in the list box at a time. For example only records with
people with last names starting with "C".

I just can't seem to get this to work.

Help Please!!


 




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


All times are GMT +1. The time now is 01:51 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.