Lookup field versus lookup table?? and sorting??

J

JR Hester

Using Access 2000.
Thought I understook lookups until I read some of the posts.
tables>Fields layout:
Classes>classID(PK), classname, desc1, desc2, hours
Students>StudID(PK), fname, lname, etc, etc
ClassAttend>TrxID(PK), Student(FK), Class(FK),registered(Y/N), completed(Y/N)

I used the lookup wizard in the ClassAttend table to direct the Student
field to look to the Students.StudID, and the Class field to classes.ClassID.
I have a form for entering my data and teh lookup has worked fine until
recently. I have been typing teh first few characters of teh class name in
the form to bring up the correct record. Recent additions have resulted in
multiple classes that have similar names, and OF COURSE they are not
together.

?? Is there a simple way to sort the lookups IN THE FORM so that they
dsiplay in alphabetrical name order rather than teh default PRIMARY KEY
order? I did try simply sorting the relevalet table on the name field, but
alas that seems to have no effect on the lookup display in the form. And I
have not FOUND a way to sort said lookup from the form DESIGN view.

Suggestions are appreciated, especially if they do not involve VBA coding.
Just have not gotten that far yet!
 
D

Duane Hookom

You can remove the lookup properties of the field in your table. Then, on
your form, set the sorting of the combo box using the Row Source property.

SELECT ClassID, ClassName
FROM Classes
ORDER BY ClassName;

Try to avoid any use of lookup fields in tables.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top