Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to order by date in access vba command?

Posted on 2010-11-24
3
Medium Priority
?
340 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

610 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