[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2011-10-18
2
Medium Priority
?
317 Views
Last Modified: 2012-05-12
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.
0
Comment
Question by:ssmith94015
2 Comments
 
LVL 9

Accepted Solution

by:
sshah254 earned 2000 total points
ID: 36989515
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

SS
0
 

Author Closing Comment

by:ssmith94015
ID: 36989530
Never would have thought of that, thank you.

Sandra
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

864 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