Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 12th, 2005, 02:32 PM
Authorized User
 
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Automatically Applying Advanced Filter / Sort

I'm trying to sort the records of a form by an expression called
Val(ProvenienceNumber). The only way that I know how to do this is in Form view going to Records - Filter - Advanced Filter/Sort, entering the expression and filtering the records. How do I programatically get Access to do this on a OnLoad or OnOpen event so my clients don't have to do this every time they want to look at sorted records?

Thank you,

Brian


 
Old November 14th, 2005, 08:55 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

What is the record source of the Form? A query or table? If it is a query, then sort the query, and the form will reflect that sort.


mmcdonal
 
Old November 14th, 2005, 01:49 PM
Authorized User
 
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The recordsource on this form is a table.

Quote:
quote:Originally posted by mmcdonal
 What is the record source of the Form? A query or table? If it is a query, then sort the query, and the form will reflect that sort.


mmcdonal
 
Old November 14th, 2005, 04:32 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You should be able to use the Order By field on the data tab of the form. Is this not working?


What are you doing by hand to filter the records? What expression are you entering?


mmcdonal
 
Old November 24th, 2005, 04:18 PM
Authorized User
 
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi mmcdonal,

Instead of using the Val() expression, I changed my text field into two separate number fields, and am sorting the fields by the two number fields.

Thanks for your help, though!

Bridog39






Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 12 Try It Out: Applying Filter (pg 400) Deepeshk ASP.NET 3.5 Basics 2 July 12th, 2008 10:28 AM
Chapter 12 (page 400) Try It Out: Applying Filter Deepeshk BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:18 AM
Dynamic sort order or sort datatype kapy_kal XSLT 2 September 18th, 2007 02:10 PM
Macro/Date/Advanced Filter alexyss15 Excel VBA 1 March 30th, 2006 01:06 PM
how to sort cross tab.sort based on row total joxa83 Crystal Reports 7 March 2nd, 2006 09:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.