Sorting a Query through VB

jemar707311

Registered User.
Local time
Today, 12:57
Joined
Aug 1, 2001
Messages
14
I am sure this is an easy one for the pros. I am new at this and love these forums, I have learned so much. Here is my newest stumbling block:

I am using a form to allow users to identify criteria for a query. When the records are returned,(using a form)I want to give them four sort options via an optiongroup on that form. What code to I use to resort the records based on the option selected? (hope this makes sense)

Also, another easy one: I want the users to be able to delete a record via a button (i removed all menus and toolbars). what code for this?

(i am a code copier and paster, it has worked great for me, i have several applications up and running from code i didn't write, only manipulated.) any suggesttion appreciated.
 
On the OnClick event of the option group, you need code that tests which option is selected, something like:

If Me.FrameName = 1 Then
'expression
End If

(actually, Select/Case is porbably more elegant)

Then to sort the subform, you need something like:
Me.SubFormName.Form.OrderBy = "Table.Field"

HTH

Mike
 
Thanks. This worked great.
 

Users who are viewing this thread

Back
Top Bottom