Solved

ListBox in Access

Posted on 2014-03-18
10
519 Views
Last Modified: 2014-03-30
Have a Query that is the record source for a ListBox on a Form in Access that lists thousands of rows.
Query retrieves rows in sorted order, but it is very lengthy to scroll through.
Like the ListBox because item(s) can be selected thus avoiding data entry errors.
Just seeking some method that would make scrolling through a lengthy ListBox less painful.
0
Comment
Question by:clock1
  • 5
  • 4
10 Comments
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39937411
Is your query sorted? and does the sort field have an index in the table?
0
 

Author Comment

by:clock1
ID: 39937494
Query is sorted. No index.
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39937520
index will help. are you sorting strings or IDs?
extreme alternative is copy the two columns into a local temp table and use that as the source - need to refresh content where applicable.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:clock1
ID: 39937529
Sorting strings. Not familiar with index. Is that set in the query somewhere?
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39937531
Another option would be a subform containing a datasheet of the two columns.

With the datasheet, you would get the benefits of the right click, which gives you filtering capabilites.

Combine that with the temp table Coachman99 mentioned if you want to be able to select more than one item from the subform.  To do this, you would also have to add a number field, populate it with 0's to start, and then create a checkbox control on the datasheet form.
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39937536
index is set on fields in table-design. Index the field you wish to sort on.
0
 

Author Comment

by:clock1
ID: 39937566
Sorted field used in query is a Expression (calculated) field.  Might have to introduce type-ahead function that progresses the list in sync with key stroke.  Wish me good luck.
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39937577
or use the sorted query to populate a local table (with an index) as the datasource
good luck :-)
0
 

Accepted Solution

by:
clock1 earned 0 total points
ID: 39954646
Resolved using a text field on the form that passes a value to a parameter query. Uses Access query engine to produce desired result.
0
 

Author Closing Comment

by:clock1
ID: 39964686
The solution involves:

One text field.
One Parameter query.
One On Enter Event to Requery.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
This collection of functions covers all the normal rounding methods of just about any numeric value.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

808 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