Solved

How to order by date in access vba command?

Posted on 2010-11-24
3
328 Views
Last Modified: 2012-05-10
I have the following code
DoCmd.OpenForm "comform", , , "FundName='" & Me.List39.Value & "'", , acDialog

how would I make it so when it opens the form it will sort them by date?
0
Comment
Question by:awesomejohn19
3 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 34205717
The form has an OrderBy property, so you could set that property in the forms design view, in the property dialog.

You could also use an OrderBy clause in the query that is the recordsource for the form.
0
 
LVL 39

Expert Comment

by:als315
ID: 34205807
You can add two strings after docmd:
Forms!comform.orderby = "ID DESC"
Forms!comform.OrderByOn = True
in "" - field and sequence.
0
 
LVL 19

Expert Comment

by:MINDSUPERB
ID: 34205885
With als315 comment, you may try this one as well:

Forms!conform.OrderBy = "YourDateField DESC"
Forms!conform.OrderByOn = True

You may use ASC for ascending.

Sincerely,
Ed
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

809 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