Edit Form in Datasheeet View

depawl

Registered User.
Local time
Today, 01:04
Joined
May 19, 2007
Messages
144
I have developed an application that involves opening a form in datasheet view from a main menu. The form shows all the records from a table. I would like to be able to sort the records from this datasheet view. The option to "apply filter/sort" is available from the Records pulldown menu, but it doesn't seem to do anything. I've applied "allow edits", etc. in the properties of the form but it doesn't seem to make any difference. Any suggestions?
Thanks.
 
Try using the A->Z and Z->A buttons (although they're pictured with the A and Z on top of, or beneath each other). First select the column to be sorted, then click the button.

HTH

Tim
 
That's the problem. I can't get those buttons to appear in datasheet view.
 
Make sure you have the "form View" tool bar visible.

Click on View ---> Toolbars ---> Form View
 
Mind, using the button does not actually store the sort order; the sort order is lost when you close and reopon the form. If you want your datasheet to show same order everytime you open it, you need to base it on a query with sort order specified.
 
Thanks to all who responded, Enabling the toolbar and changing the form to a query resolved the problem.
 
Mind, using the button does not actually store the sort order; the sort order is lost when you close and reopon the form.
Actually, the sort order gets stored in the Order By property of the form. And when the form is closed and re-opened, the previously set sort order remains. Personally I think this is the best and easiest place to sort forms. Setting the sort order here will overide and query sorting.
Chris
 
Actually, the sort order gets stored in the Order By property of the form. And when the form is closed and re-opened, the previously set sort order remains. Personally I think this is the best and easiest place to sort forms. Setting the sort order here will overide and query sorting.
Chris

I wouldn't rely on that, it's not guaranteed;)
 
The only way to ensure the correct sort order you want, each time you open the form, is to store it (a table would be a good way) upon close of the form and retrieve it upon load and apply it then.
 
No, but neither is the query. I agree with Bob if you want belts and braces.

Hmm. I'm pretty sure query *always* return the correct order if you specified a ORDER BY clause.

Binding all forms to queries instead of tables gives you the flexibility to order data in whatever you like, and even in ways that Sort By button can't do. It's also more efficient.

I've yet to see a form that didn't have the correct sort order when its recordsource is based on a query with a ORDER BY clause, and no code is required to maintain the correct sort.
 
Hmm. I'm pretty sure query *always* return the correct order if you specified a ORDER BY clause.
I agree. However, it is overidden by the sort order in the form which the user can easily apply/change. And because it is saved (not 100% guaranteed ;) ) then you can't rely on the sort order of the query to do the job for you because the form will take precedence. I guess you can remove the ability for the user to sort but I just think it's easier to apply the sorting at the form stage. If I want it to happen every time I open the form regardless of any sorting done last time the form was open then I just stick some code in the On Open event.

Binding all forms to queries instead of tables gives you the flexibility to order data in whatever you like, and even in ways that Sort By button can't do. It's also more efficient.
Afaik, you can apply any sort order in the Order By property that you would otherwise do in a query. I agree though the button alone is pretty basic.

Chris
 

Users who are viewing this thread

Back
Top Bottom