Ordering data based on a selection

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi all,

I'd like to alphabetically order the data, shown as columns, in a continuous
form (order_id, type, category) based on a selection in an option frame in
the footer of the form. I know it can be done via the menu bar and selecting
the column but this option is not available to the user.

TIA

Mike

A03 connected to SQL2k
 
Hi all,

I'd like to alphabetically order the data, shown as columns, in a continuous
form (order_id, type, category) based on a selection in an option frame in
the footer of the form. I know it can be done via the menu bar and selecting
the column but this option is not available to the user.

You can change the Form's OrderBy property in the AfterUpdate event
procedure of the option group. Air code:

Private Sub optSortBy_AfterUpdate()
Select Case Me!optSortBy
Case 1
Me.OrderBy = "Order_ID"
Case 2
Me.OrderBy = "[Type]"
Case 3
Me.OrderBy = "Category"
End Select
Me.OrderByOn = True
End Sub


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