Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Applied sort on a datasheet view form

Posted on 2014-01-30
2
Medium Priority
?
1,497 Views
Last Modified: 2014-01-31
If the user applies a sort to a column on a datasheet view form, can I make it default back to the sort order as defined in the form properties the next time it is opened?  It seems to remember the last sort and this is not what I want.
0
Comment
Question by:SteveL13
2 Comments
 
LVL 10

Accepted Solution

by:
Gozreh earned 1000 total points
ID: 39822639
On Load you should enter this
Me.OrderBy = ""
0
 
LVL 49

Assisted Solution

by:Dale Fye
Dale Fye earned 1000 total points
ID: 39822934
If you allow them to open the datasheet and then save it when it closes, then it will retain the OrderBy property of the form.  As Gozreh mentions, one way to remove that is to set the OrderBy property on form load.

Another way to do it is to embed the datasheet into another form and give that form button to close it.  in the code behind that button, use:

Private Sub cmd_Close_Click()

    DoCmd.Close acForm, Me.Name, acSaveNo
   
End Sub

This will prevent the changes made to the datasheet sort order, column position, and column width from saving when the main form is closed.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

783 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