Resultsset order

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a user ID field in my query. I want know how to pass that to look up
the records with only that user ID. What I want instead is to get back ALL
the records (with and without that specific user ID) but I want the
specificed userID to show up in the top of the list of records I display in a
form.

Example: User ID = 7

I would like to see records returned (or displayed) in this order:

7 smith
7 smith
7 smith
7 smith
1 jones
4 burns
5 doe
6 ball
8 reills
9 johnson

Any ideas or suggestions on how I can do this? I am trying to make it
easier on the user since 80% of the time they will choose the 1st user listed
(#7 in this case)
 
There is no obvious rhyme nor reason in the desired output to sort on.
Therefore you are going to need a SortOrder field in your User table that you
manually number to obtain the desired results in a query.
 
Can you give me an example? Could I create a computed field in my query so
when I called and passed in the UserID as part of the criteria It could set
the field to 1 else 0? I can't figure out how to access my passed in
criteria expression inside my query other than in the field the criteria is
for....

Ex. DoCmd.OpenForm "qryUserList", , , "UserID=" & Me.UserID

Then inside my qryUserList how would I reference the value of Me.UserID that
was passed in without using the formname!field....? (this query is used by
multiple forms)

Thx
 
Back
Top