Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How stay on the original record after changing the record order 1

Status
Not open for further replies.

rew2009

Technical User
Apr 21, 2009
114
US
I am using a form with a record source from a query. How stay on the original record after I change the sort order from within a cmd button. I am using the code:

Me.OrderByOn = False
Me.OrderBy = "Client DESC"
Me.OrderByOn = True

Thanks
 
How are ya rew2009 . . .

Perhaps the following. Note the primarykey is assumed to be numeric. If text ... changes are required accordingly:
Code:
[blue]   Dim Cri As String
   
   [b]Cri[/b] = "[[purple][B][I]Your!PrimarykeyName[/I][/B][/purple]] = " & Me![[purple][B][I]Your!PrimarykeyName[/I][/B][/purple]]
   
   Me.OrderByOn = False
   Me.OrderBy = "Client DESC"
   Me.OrderByOn = True

   Me.Recordset.FindFirst [b]Cri[/b][/blue]
[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
It looks good, I'll try it, Thanks
 
It Worked Perfectly, Thanks TheAceMan1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top