Go to first record int able with user name from drop-down

I have a form that when teh user selects a name from the drop-down, I want the form to present the first record in the table that belongs to that user name.  There would be multiple records with the user's name, but I want the form to present the first record.  This is an ACCESS 2003 databse and needs to be written in VBA.  I can get to the last record and the first in the recordset, but i want to go to the first for a particular user.
Sandra SmithRetiredAsked:
Who is Participating?
sshah254Connect With a Mentor Commented:
let's say the user name is user1, and the table name is table1 and the order field is whateverorder then the following query will give you the desired data

Select top1 * from
(select * from table1 where username = user1 order by whateverorder) x

Sandra SmithRetiredAuthor Commented:
Never would have thought of that, thank you.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.