?
Solved

How to order by date in access vba command?

Posted on 2010-11-24
3
Medium Priority
?
334 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Accepted Solution

by:
Dale Fye earned 2000 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 40

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

765 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