Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sorting a datasheet view

Status
Not open for further replies.

BitZero

Programmer
Mar 11, 2008
100
US
I have a data entry form that is displayed in "datasheet" mode, so that you can see multiple records on the screen. When testing, I get into Access while holding down the shift key, and I'm able to right click on a column, and then click the sort ascending or sort descending button to sort that column. However, if I get into Access without holding down the shift key, then I can't right click on a column and sort data. Is there a way to allowing sorting the datasheet without the shift key trick? Thanks
 
What ever opens your form could include a sort order. Not sure if this next suggestion is possible but try using the toolbar to sort the orders. Finally, you could change the form to a continuos form and use the headings to sort the orders.

Ian Mayor (UK)
Program Error
9 times out of 10 I know what I'm talking about. This must be my tenth reply.
 
Thanks for the quick replies.

How do you specify a sort order when opening a form? Here's the code I'm using now to open the form:

stDocName = "frmEmployee"
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria

Also, I have the following code on the initial menu form load event:

CommandBars("Menu Bar").Enabled = False

However what controls whether I can right click and sort is the "shift key" when entering the database. Does the shift key enable some property? Can that property be disabled in the code?

Thanks
 
stlinkcriteria is the place where a query name should be placed with its own sort order.

Ian Mayor (UK)
Program Error
9 times out of 10 I know what I'm talking about. This must be my tenth reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top