Microsoft Office Tutorials and References
In Depth Information
Making a Rolodex-type Selection List Box
corrects that. When selecting all records, the whole WHERE clause can be
dropped.
The second section uses the standard record processing loop and starts with
testing if there are records selected using IF rs.EOF AND rs.BOF THEN. The
IF rs.EOF looks odd, perhaps, but it is short for IF rs.EOF = True. As both EOF
(End Of File) and BOF (Beginning Of File) are Boolean values, they can only
hold True or False.
Note: Testing to ensure that records are selected should always be coded so that
there is at least one record to process in the loop. When there is no record,
the rs.movefirst that is intended to set the cursor to the first record will fail.
Within the WHILE / WEND loop, the last statement is rs.movenext to ensure
that a new record is processed the next time. If this statement is omitted, the
loop will run forever.
Making a Rolodex-type Selection List Box
This procedure demonstrates how to use a datasheet tabbed like a Rolodex
using the first character of the names.
Example file:
A010.mdb with a
form frmNameSelect
Scenario: A rather intuitive way of selecting names is to
use a tabbed list to do the selection. There is a tabbed
control in Access, but making 26 separate controls and
controlling them requires a lot of code. It is possible to mimic
such a control by using a list box and the selected letter to
do the filtering.
Acs
 
Search JabSto ::




Custom Search