Sorting

  • Thread starter Thread starter Guest
  • Start date Start date
How do I disable sorting?

Please explain.

Records must be presented in SOME order. There is no "overprint" or
"all at once" option on most computer screens!

Note that records in an Access Table are stored and presented in
whatever order Access finds convenient. If you want to see them in the
order in which they were entered, it's best to include either a
sequential autonumber field or a timestamp field with a default value
of Now(), and use a query sorted by this field.

John W. Vinson[MVP]
 
I have a datasheet form that brings up a record in another form when the user
double-clicks on a record. Both forms have to be sorted the same way
otherwise Access does not open the correct record. I want to disable the
sort so that users do no mess up the orders. Make sense?
 
I have a datasheet form that brings up a record in another form when the user
double-clicks on a record. Both forms have to be sorted the same way
otherwise Access does not open the correct record. I want to disable the
sort so that users do no mess up the orders. Make sense?

If you're making assumptions about the order of records in a table to
find records in another table, you're on the wrong track. Relational
databases don't work that way!

I'd VERY strongly recommend - insist even <g> - that you should have
some matching unique field in the two tables, and link the two tables
by the value of that field. That's how relational databases are
designed to work.

Could you post your doubleclick code?

John W. Vinson[MVP]
 
Yes, I understand how relational databases work, thanks. This is 2 FORMS
using the same table data. One in datasheet view, then double-click to get
to columnar view for a single record.

Double-click code:

Private Sub Form_DblClick(Cancel As Integer)
Dim num As Long

num = Me.CurrentRecord

DoCmd.OpenForm "T_Request"
DoCmd.GoToRecord acDataForm, "T_Request", acGoTo, num

End Sub

Thanks for your assistance.
 
Yes, I understand how relational databases work, thanks. This is 2 FORMS
using the same table data. One in datasheet view, then double-click to get
to columnar view for a single record.

Double-click code:

Private Sub Form_DblClick(Cancel As Integer)
Dim num As Long

num = Me.CurrentRecord

DoCmd.OpenForm "T_Request"
DoCmd.GoToRecord acDataForm, "T_Request", acGoTo, num

End Sub

Thanks for your assistance.

As opposed to

DoCmd.OpenForm "T_Request", WhereCondition:= "[ID] = " & Me![ID]

which doesn't depend on the order of records in the table?

John W. Vinson[MVP]
 
Thanks! That works much better, I didn't even think about the wherecondition
option.

John Vinson said:
Yes, I understand how relational databases work, thanks. This is 2 FORMS
using the same table data. One in datasheet view, then double-click to get
to columnar view for a single record.

Double-click code:

Private Sub Form_DblClick(Cancel As Integer)
Dim num As Long

num = Me.CurrentRecord

DoCmd.OpenForm "T_Request"
DoCmd.GoToRecord acDataForm, "T_Request", acGoTo, num

End Sub

Thanks for your assistance.

As opposed to

DoCmd.OpenForm "T_Request", WhereCondition:= "[ID] = " & Me![ID]

which doesn't depend on the order of records in the table?

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top